依赖更新 && 构建调整 (#60)
* upgrade dependencies * 更改所有 saladcss 写法 * fix: 升级依赖导致的样式错误 * fix: build vant css * use es module when pack && webpack scope hoisting * fix: vue module version * delete unused npm script * fix: build:vant script not work * fix: webpack config format * fix: build minify vant.js * fix: captain ui relative link
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import Vue from 'vue';
|
||||
import merge from 'src/utils/merge';
|
||||
import ToastComponent from './toast.vue';
|
||||
|
||||
const ToastConstructor = Vue.extend(require('./toast.vue'));
|
||||
const ToastConstructor = Vue.extend(ToastComponent);
|
||||
let instance;
|
||||
|
||||
const getInstance = () => {
|
||||
@@ -24,6 +25,7 @@ var Toast = (options = {}) => {
|
||||
const duration = options.duration || 3000;
|
||||
|
||||
const instance = getInstance();
|
||||
|
||||
instance.closed = false;
|
||||
clearTimeout(instance.timer);
|
||||
instance.type = options.type ? options.type : 'text';
|
||||
|
||||
@@ -1,24 +1,18 @@
|
||||
<template>
|
||||
<transition name="van-toast-fade">
|
||||
<div class="van-toast-wrapper" v-show="visible">
|
||||
<div class="van-toast" :class="['van-toast--' + displayStyle]">
|
||||
<div :class="['van-toast', 'van-toast--' + displayStyle]">
|
||||
<!-- 只显示文字 -->
|
||||
<template v-if="displayStyle === 'text'" >
|
||||
<div class="van-toast__text">{{message}}</div>
|
||||
</template>
|
||||
<div v-if="displayStyle === 'text'" class="van-toast__text">{{ message }}</div>
|
||||
<!-- 加载中 -->
|
||||
<template v-if="displayStyle === 'loading'">
|
||||
<van-loading v-if="type === 'loading'" type="gradient-circle" color="white"></van-loading>
|
||||
</template>
|
||||
<van-loading v-if="displayStyle === 'loading' && type === 'loading'" type="gradient-circle" color="white"></van-loading>
|
||||
<!-- 图案加文字 -->
|
||||
<template v-if="displayStyle === 'default'">
|
||||
<van-icon class="van-toast__icon" :name="type"></van-icon>
|
||||
<div class="van-toast__text">{{message}}</div>
|
||||
<div class="van-toast__text">{{ message }}</div>
|
||||
</template>
|
||||
<!-- 传入html -->
|
||||
<template v-if="displayStyle === 'html'">
|
||||
<div class="van-toast__text" v-html="message"></div>
|
||||
</template>
|
||||
<div v-if="displayStyle === 'html'" class="van-toast__text" v-html="message"></div>
|
||||
</div>
|
||||
<div class="van-toast__overlay" v-if="forbidClick"></div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user