Files
mes-ui-d2/dev/snippets/vue.json
liyang ad42e63596 更新文档地址
Former-commit-id: 4137f480abbafb30b042aa6c22bdf65eb262076c [formerly 77bbdb1c240c6923e5068c4c9e61996b9550de05] [formerly 4137f480abbafb30b042aa6c22bdf65eb262076c [formerly 77bbdb1c240c6923e5068c4c9e61996b9550de05] [formerly 4137f480abbafb30b042aa6c22bdf65eb262076c [formerly 77bbdb1c240c6923e5068c4c9e61996b9550de05] [formerly 77bbdb1c240c6923e5068c4c9e61996b9550de05 [formerly 12daffb58a923498833c5fca09de792678b175b3 [formerly 5cb54b7121fc0a4c8c77aa38df2d1633adf9532c]]]]]
Former-commit-id: a74369eb2392e1d6ea02a435b06d1bdd8304fa0d
Former-commit-id: 77371d307e6cd49b4c18d1bab0943cd7e67047ea
Former-commit-id: de489644e77e5948db9df9fea279ac1ba12b021c [formerly 204feb9ec86fb13ca6c7af4a2242f72ce7350d72]
Former-commit-id: db5c30d31c859e4ab4ceaff9b146b2e67827b0c9
Former-commit-id: 3092dd0c1d6c449dcb150b1010c4452840d1d795
Former-commit-id: aaa367b2c8b26551fcb642677f96d2d9acb9f28d
Former-commit-id: 3ba07266e1c2171c9c575d2e4de211d992ff609f
Former-commit-id: dae3a815ec27a509186ee88225732ec7bcb35b87
2018-08-23 08:37:46 +08:00

83 lines
2.4 KiB
JSON

{
// 一个新的页面
"d2-new-page": {
"prefix": "dd-new-page",
"body": [
"<template>",
" <d2-container class=\"${1:page-name}\">",
" <!--",
" 可选 type = full(默认) | card | ghost",
" 可选 better-scroll 属性",
" 可选 better-scroll-option 属性",
" 文档 http://app.d3collection.cn/d2-admin-doc/lastest/zh/components/container.html",
" -->",
" <template slot=\"header\">header</template>",
" <span class=\"${1:page-name}_title\">this is [ {{name}} ]</span>",
" <template slot=\"footer\">footer</template>",
" </d2-container>",
"</template>",
"<script>",
"import { mapState, mapMutations } from 'vuex'",
"export default {",
" name: '${1:page-name}',",
" data () {",
" return {",
" name: '${1:page-name}'",
" }",
" },",
" computed: {",
" ...mapState({",
" // 访问用户信息",
" userInfo: state => state.d2admin.userInfo",
" })",
" },",
" methods: {",
" ...mapMutations([",
" // 操作公用数据",
" 'd2adminUtilDatabase',",
" // 操作用户私有数据",
" 'd2adminUtilDatabaseUser'",
" ])",
" }",
"}",
"</script>",
"<style lang=\"scss\" scoped>",
"@import '~@/assets/style/public.scss';",
".${1:page-name} {",
" .${1:page-name}_title {",
" font-size: 14px;",
" }",
" // Your page style here",
" // Do not use empty rulesets",
" // If the page does not need an additional definition style, please delete",
"}",
"</style>"
],
"description": "new page"
},
// d2-container 组件 header 插槽
"d2-container-header": {
"prefix": "dd-container-header",
"body": [
"<template slot=\"header\">${1:header}</template>"
],
"description": "d2-container component header slot"
},
// d2-container 组件 footer 插槽
"d2-container-footer": {
"prefix": "dd-container-footer",
"body": [
"<template slot=\"footer\">${1:footer}</template>"
],
"description": "d2-container component footer slot"
},
// 图标组件
"d2-icon": {
"prefix": "dd-icon",
"body": [
"<d2-icon name=\"${1:github}\"/>"
],
"description": "d2-icon component"
}
}