uView Alert 警告提示

简介: uView Alert 警告提示

警告提示,展现需要关注的信息。

#使用场景

  • 当某个页面需要向用户显示警告的信息时。
  • 非浮层的静态展现形式,始终展现,不会自动消失,用户可以点击关闭。

#平台差异说明

App(vue) App(nvue) H5 小程序

#基本使用

  • 通过titledescription设置组件的标题和描述内容
  • 通过type设置主题类型,有primary,success,error,warning,info可选值
  • 通过effect设置主题浅或深色调,有light(浅色 默认),dark(深色)可选值
<template>
  <view>
    <u-alert :title="title" type = "warning" :description = "description"></u-alert>
    <u-alert :title="title" type = "warning" effect="dark" :description = "description"></u-alert>
  </view>
</template>
<script>
export default {
  data() {
    return {
      title:'uView的目标是成为uni-app生态最优秀的UI框架',
      description:'uView是uni-app生态专用的UI框架'
    };
  },
  onLoad() {},
  methods: {
  }
};
</script>

copy

#图标

通过showIcon设置是否显示图标,作用是让信息类型更加醒目。

注意:当前版本图标为uView内置图标,根据type参数显示不同的图标,无法自定义。

<u-alert type="warning" :show-icon="true"></u-alert>

copy

#可关闭的警告提示

显示关闭按钮,点击可关闭警告提示。

  • closable参数配置是否可关闭
<template>
  <view>
    <u-alert :title="title"  type = "warning" :closable="closable" :description = "description"></u-alert>
  
  </view>
</template>
<script>
export default {
  data() {
    return {
      title:'uView的目标是成为uni-app生态最优秀的UI框架',
      description:'uView是uni-app生态专用的UI框架',
      closable:true
    };
  },
  onLoad() {},
  methods: {
  }
};
</script>
目录
打赏
0
0
0
0
10
分享
相关文章
HBuilder报错文件查找失败:'./pages/info/info/info.vue' at main.js:3解决办法
HBuilder报错文件查找失败:'./pages/info/info/info.vue' at main.js:3解决办法
5374 0
百度智能云“千帆大模型平台”升级:大模型最多,Prompt模板最全(上)
百度智能云“千帆大模型平台”升级:大模型最多,Prompt模板最全
359 1
Containers feature is disabled. Enable it using the PowerShell script (in an administrative PowerShe
Containers feature is disabled. Enable it using the PowerShell script (in an administrative PowerShe
202 0
uniapp实战 —— 自定义顶部导航栏
uniapp实战 —— 自定义顶部导航栏
334 2
uniapp中uview组件库的AlertTips 警告提示使用方法
uniapp中uview组件库的AlertTips 警告提示使用方法
503 2
PyTorch深度学习框架入门与应用
PyTorch 提供了丰富的工具和 GPU 加速功能,便于构建和训练神经网络。基础包括:1) 张量,类似 NumPy,支持 GPU 计算;2) 自动微分,方便计算梯度;3) 内置神经网络模块 `nn`。PyTorch 还支持数据并行、自定义层、模型保存加载、模型可视化和剪枝量化等进阶用法。通过不断学习,你将能掌握更多高级功能。【6月更文挑战第6天】
205 8
糊涂工具类(hutool)post请求设置body参数为json数据
糊涂工具类(hutool)post请求设置body参数为json数据
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等

登录插画

登录以查看您的控制台资源

管理云资源
状态一览
快捷访问