-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
文档数据结构: 后期参考方案渲染到html,配合例子和demo #5
Comments
今天在没有思路的情况下,大鹏给我了一个思路 var btn = {
props: [
{
name: 'type',
type: 'String',
default: 'button',
description: `sss`
},
{
name: 'color',
type: 'String',
default: 'blue',
description: `定义的颜色`
}
],
slots: [
{
name: 'default',
comment: '内容'
}
],
events: [
{
name: 'changeColor',
description: `改变颜色`
},
],
examples: [
{
name: 'type',
text: `
<hf-button :type="button"
@changeColor="active = !active">
<hf-button>
`
},
{
name: 'color',
text: `
<hf-button :color="blue"
@changeColor="active = !active">
<hf-button>
`
}
]
} 这个是大鹏给的例子,然后我又拓展了一下,觉得这样定义确实挺清晰 |
export default {
name: 'btn',
props: {
type: {
type: String,
default: 'default'
},
size: String,
icon: {
type: String,
default: ''
},
loading: Boolean,
disabled: Boolean
},
methods: {
handleClick(evt) {
this.$emit('click', evt); (子传父)
}
}
} |
var btn = {
props: [
{
name: 'type',
type: 'String',
default: 'button',
description: `sss`
},
{
name: 'color',
type: 'String',
default: 'blue',
description: `定义的颜色`
}
],
slots: [
{
name: 'default',
comment: '内容'
}
],
events: [
{
name: 'changeColor',
description: `改变颜色`
},
],
examples: [
{
name: 'type',
text: `
<hf-button :type="button"
@changeColor="active = !active">
<hf-button>
`
},
{
name: 'color',
text: `
<hf-button :color="blue"
@changeColor="active = !active">
<hf-button>
`
}
]
} 文档就按这个模板这样写,一个组件一个js文件,然后这些文档作为数据层,再利用Vue服务端渲染(sav-Vue框架)到页面html,时间大概一周,从下周起,每天要过一下,设计也要给出官网草图 |
文档数据结构: 后期参考方案直接将文档渲染到html,配合例子和demo,由我和晓飞完成
The text was updated successfully, but these errors were encountered: