`
const data =
`
table:[{
id:1,
kind:"图集",
title: "图集· 日光倾城",
author: "Amanda",
likes: 190
},{
id:2,
kind:"图集",
title: "图集·军训,再见",
author: "Rose",
likes: 18
},{
id:3,
kind:"水墨",
title: "乐在桂花节",
author: "Elegenthus",
likes: 189
},{
id:4,
kind:"新闻",
title: "关于实施校园网运营服务模式改革相关情况的说明",
author: "Cruyun",
likes: 1001
}]
`
return {
html: escapeHtml(html),
data: data,
table: [{
id: 1,
kind: "图集",
title: "图集· 日光倾城",
author: "Amanda",
likes: 190
}, {
id: 2,
kind: "图集",
title: "图集·军训,再见",
author: "Rose",
likes: 0
}, {
id: 3,
kind: "水墨",
title: "乐在桂花节",
author: "Elegenthus",
likes: 189
}, {
id: 4,
kind: "新闻",
title: "关于实施校园网运营服务模式改革相关情况的说明",
author: "Cruyun",
likes: 1001
}],
apiInfo: [{
prop: "prop",
type: "string",
description: "Column data. Should match the key of table data object",
default: "/"
},
{
prop: "label",
type: "string",
description: "Thead text",
default: "/"
},
{
prop: "width",
type: "string",
description: "Column width",
default: "/"
}
],
}
}
})
const switchDemo = Vue.extend({
template: "#switchDemo",
data: function () {
const html =
`
Switch
`
return {
value: "left"
}
},
methods: {
// change:function(){
// console.log("changed! " + this.value)
// },
}
})
const layoutDemo = Vue.extend({
template: "#layoutDemo",
data: function () {
const html =
`
8/24
8/24
8/24
`
const gutter = `
6/24
6/24
6/24
6/24
`
const justify = `
6/24
6/24
6/24
6/24
6/24
6/24
6/24
`
const grow = `
grow item
6/24
6/24
`
return {
html: escapeHtml(html),
gutter: escapeHtml(gutter),
justify: escapeHtml(justify),
grow: escapeHtml(grow),
value: "left",
layoutApiInfo: [{
prop: "gutter",
type: "number",
description: "Property of component. Grid spacing",
default: "0"
},
{
prop: "justify",
type: "string",
description: "Property of component. Horizontal alignment",
default: "flex-start"
},
{
prop: "span",
type: "number",
description: "Required property of component.",
default: "/"
},
{
prop: "flexGrow",
type: "string",
description: "Property of component. Same as flex-grow of flex layout",
default: "0"
}
]
}
},
})
const demo = new Vue({
el: ".app",
template: "#demo",
data: function () {
return {
type: "button"
}
},
methods: {
switchType: function (type) {
this.type = type
console.log(type)
}
},
components: {
"button-demo": buttonDemo,
"toast-demo": toastDemo,
"form-demo": formDemo,
"radio-demo": radioDemo,
"checkbox-demo": checkboxDemo,
"datepicker-demo": datepickerDemo,
"menu-demo": menuDemo,
"table-demo": tableDemo,
"select-demo": selectDemo,
"switch-demo": switchDemo,
"layout-demo": layoutDemo
}
})