2018-07-17 14:33:33 +08:00
|
|
|
{
|
2018-07-25 09:38:17 +08:00
|
|
|
// 一个新的页面
|
|
|
|
|
"d2-new-page": {
|
|
|
|
|
"prefix": "dd-new-page",
|
|
|
|
|
"body": [
|
|
|
|
|
"<template>",
|
|
|
|
|
" <d2-container class=\"${1:page-name}\">",
|
|
|
|
|
" <!--",
|
|
|
|
|
" 可选 type = full(默认) | card | ghost",
|
|
|
|
|
" 可选 better-scroll 属性",
|
|
|
|
|
" 可选 better-scroll-option 属性",
|
2018-09-03 11:04:55 +08:00
|
|
|
" 文档 https://d2-projects.github.io/d2-admin-doc/zh/components/container.html",
|
2018-07-25 09:38:17 +08:00
|
|
|
" -->",
|
|
|
|
|
" <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}',",
|
2018-07-17 14:33:33 +08:00
|
|
|
" data () {",
|
2018-07-25 09:38:17 +08:00
|
|
|
" return {",
|
|
|
|
|
" name: '${1:page-name}'",
|
|
|
|
|
" }",
|
2018-07-17 14:33:33 +08:00
|
|
|
" },",
|
2018-07-25 09:38:17 +08:00
|
|
|
" computed: {",
|
|
|
|
|
" ...mapState({",
|
|
|
|
|
" // 访问用户信息",
|
|
|
|
|
" userInfo: state => state.d2admin.userInfo",
|
|
|
|
|
" })",
|
|
|
|
|
" },",
|
|
|
|
|
" methods: {",
|
|
|
|
|
" ...mapMutations([",
|
|
|
|
|
" // 操作公用数据",
|
|
|
|
|
" 'd2adminUtilDatabase',",
|
|
|
|
|
" // 操作用户私有数据",
|
|
|
|
|
" 'd2adminUtilDatabaseUser'",
|
|
|
|
|
" ])",
|
2018-07-17 14:33:33 +08:00
|
|
|
" }",
|
|
|
|
|
"}",
|
2018-07-25 09:38:17 +08:00
|
|
|
"</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"
|
|
|
|
|
}
|
2018-07-17 14:33:33 +08:00
|
|
|
}
|