亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

使用Vant完成通知欄Notify的提示操作

 更新時間:2020年11月11日 08:41:43   作者:檸檬不萌只是酸i  
這篇文章主要介紹了使用Vant完成通知欄Notify的提示操作,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧

效果:

代碼展示:

<template>
 <!-- 通知消息提示 -->
 <div id="notify">
  <van-button type="primary" @click="toNotify" class="btn">頂部通知</van-button>
 </div>
</template>
<script>
 export default{
 data(){
  return{
  msg:''
  }
 },
 methods:{
  toNotify(){
  this.$notify({
   message:'我是提示的notify',
   background:'pink',
   duration: 1000
  })
  }
 },
 mounted() {
 
 }
 }
</script>
<style scoped="scoped">
 .btn{
 margin-top: 100px;
 }
</style>

補(bǔ)充知識:vantweapp引入notify消息提示組件解決importpath/to/@vant/weapp/dist/notify/notify和‘selectComponent‘ of undefined

**

微信小程序搭配vantweapp引入notify消息提示組件

/path/to/@vant/weapp/dist/notify/notify未找到

‘selectComponent‘ of undefined報(bào)錯

解決辦法:

** import引入相對路徑

Notify({ type: ‘success', message: ‘通知內(nèi)容' });//放入事件中

對應(yīng)js文件代碼:

import Notify from '../../miniprogram_npm/@vant/weapp/notify/notify';
Page({
 data: {},
 //btnSub是事件名
 btnSub() {
 Notify({ type: 'success', message: '通知'});
 }
})

wxml文件代碼

<van-notify id="van-notify" />

app.json文件代碼

"usingComponents": {
 "van-notify": "@vant/weapp/notify/index"
}

以上這篇使用Vant完成通知欄Notify的提示操作就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論