update Modal prop draggable

This commit is contained in:
梁灏 2018-07-14 18:31:22 +08:00
parent 7fb5f3b3ee
commit 1210cfe59c
7 changed files with 48 additions and 96 deletions

View file

@ -1,87 +1,39 @@
<template>
<div>
<p>带描述信息</p>
<Button @click="normal(false)">普通</Button>
<Button @click="normal(true)">普通</Button>
<Button @click="info(false)">消息</Button>
<Button @click="info(true)">消息</Button>
<Button @click="success(false)">成功</Button>
<Button @click="warning(false)">警告</Button>
<Button @click="error(false)">错误</Button>
<Button @click="testRender()">render</Button>
<p>仅标题</p>
<Button @click="info(true)">消息</Button>
<Button @click="success(true)">成功</Button>
<Button @click="warning(true)">警告</Button>
<Button @click="error(true)">错误</Button>
<Button @click="destroy()">销毁</Button>
</div>
<Select v-model="model1" style="width:200px">
<Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
</Select>
</template>
<script>
export default {
methods: {
normal (nodesc) {
this.$Notice.open({
title: 'google',
duration: 0,
desc: nodesc ? '' : '这里是通知描述这里,是通知描述这里是通知描述这里,是通知描述这里,是通知描述这里是通知描述这里是通知描述',
// render (h) {
// return h('span', {}, 'sdsdfsdf');
// }
});
},
info (nodesc) {
this.$Notice.info({
title: '这是通知标题',
duration: 0,
desc: nodesc ? '' : '这里是通知描述这里,是通知描述这里是通知描述这里,是通知描述这里,是通知描述这里是通知描述这里是通知描述',
// render (h) {
// return h('span', {}, 'sdsdfsdf');
// }
});
},
success () {
this.$Notice.success({
title: '这是通知标题',
desc: '当你定义了render之后这个描述会被覆盖',
render: h => {
return h('span', {}, [
'这是',
h('Button', {props: {type: 'text'}}, 'render'),
'函数渲染的'
]);
data () {
return {
cityList: [
{
value: 'New York',
label: 'New York'
},
duration: 0
});
},
warning (nodesc) {
this.$Notice.warning({
title: '这是通知标题',
desc: nodesc ? '' : '这里是通知描述这里,是通知描述这里是通知描述这里,是通知描述这里,是通知描述这里是通知描述这里是通知描述',
});
},
error (nodesc) {
this.$Notice.error({
title: '这是通知标题',
desc: nodesc ? '' : '这里是通知描述这里,是通知描述这里是通知描述这里,是通知描述这里,是通知描述这里是通知描述这里是通知描述'
});
},
testRender () {
this.$Notice.info({
title: '这是通知标题',
duration: 0,
// desc: 'render',
render: h => {
return h('span', {}, [
'这是',
h('Button', {props: {type: 'text'}}, 'render'),
'函数渲染的'
]);
{
value: 'London',
label: 'London'
},
});
},
destroy () {
this.$Notice.destroy();
{
value: 'Sydney',
label: 'Sydney'
},
{
value: 'Ottawa',
label: 'Ottawa'
},
{
value: 'Paris',
label: 'Paris'
},
{
value: 'Canberra',
label: 'Canberra'
}
],
model1: 'Sydney'
}
}
}