Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>mg-snippetsNew to Visual Studio Code? Get it now.

mg-snippets

Magxl

|
6 installs
| (0) | Free
let me faster
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

IDE

vscode setting.json 配置

增加 ↓↓↓
  "editor.quickSuggestions": {
    "other": true,
    "comments": true,
    "strings": true
  },

钉钉文档

  • 「代码块及公共壳组件的使用」

1.主要

  • Vue3

dv3 定义v3文件模版
dv3-page 以<Page>壳组件定义v3文件模版 ⭐️荐⭐️
Page接收type来识别使用哪个壳样式,type: UI | ''

v3- 使用vue3的片段
{
  props: 使用传参,
  data: 定义data,
  cpu: 使用computed,
  watch: 使用watch,
  this: 使用proxy获取实例,
  mounted: 使用挂载周期,
  unmounted: 使用卸载周期
  emit: 使用emit,
  expose: 抛出事件可让父组件调用,
  store: 使用inject注入store,
  router: 使用router,
  route: 使用route,
  slot: 插入slot模版片段,
  fakeData: 假数据方法,
}
  • uniapp

uni-

使用uniapp的片段

  • Init

init-

使用初始化通用代码

  • class样式

flex-
flex布局
fs 字号
txt- 
字色
bg- 
背景色
m 
外边距
m0-5 m5-0 双向写法
ml | mt | mr | mb 一侧写法
p 
内边距
p0-5 p5-0 双向写法
pl | pt | pr | pb 一侧写法

2. store

  • 实例内 tstate tcommit tdispatch
  • 仓库内 to

3. element

  • 同官方组件名 做了提示及常用配置 el-开头

4. 组件

  • 表格-dtable
  • 抽屉-ddrawer
  • 选项卡-dtabs
  • 图表
      dchart
      echart-pie-bingtu 饼图
      echart-bar-zhutu 柱图
      echart-options 配置项
    
  • 对话框-ddialog

5. 工具类

  • 假数据-dfakeData
  • 判断类型-const type = this.$getType(v) // type为各类型的大驼峰写法字符串,如'Number','String'

6. 自定义模版

  • 表单校验js方法,dvalidate-formjs

7. 定义类

  • iroute , 定义一个route模版
  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft