mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
45 lines
641 B
JavaScript
45 lines
641 B
JavaScript
const Toptips = require('../../dist/toptips/toptips');
|
|
|
|
Page({
|
|
data: {
|
|
content: '测试toptips',
|
|
duration: 2000,
|
|
$vant: {
|
|
toptips: {
|
|
show: false
|
|
}
|
|
}
|
|
},
|
|
|
|
showTopTips() {
|
|
this.setData({
|
|
$vant: {
|
|
toptips: {
|
|
show: true
|
|
}
|
|
}
|
|
});
|
|
|
|
setTimeout(() => {
|
|
this.setData({
|
|
$vant: {
|
|
toptips: {
|
|
show: false
|
|
}
|
|
}
|
|
});
|
|
},this.data.duration);
|
|
},
|
|
|
|
showTopTips2() {
|
|
Toptips('测试内容');
|
|
},
|
|
|
|
showTopTips3() {
|
|
Toptips({
|
|
duration: 1000,
|
|
content: '测试时间1秒'
|
|
})
|
|
}
|
|
});
|