VsCode Ant Design of Vue组件代码片段(2)

254 阅读1分钟

本文已参与「新人创作礼」活动,一起开启掘金创作之路

"WpAntdVueButtonSnippet": {
		"prefix": "w-button",
		"body": [
			"<a-button",
			"                type=\"primary\"",
			"                shape=\"round\"",
			"                icon=\"search\"",
			"                :loading=\"loading\"",
			"                size=\"default\"",
			"                block",
			"                @click=\"handleClickEvent\"",
			"              >查询</a-button",
			"              >",
		],
		"description": "AntdVue按钮代码片段"
	},
	"WpAntdVueSpaceSnippet": {
		"prefix": "w-space",
		"body": [
			" <a-space direction=\"horizontal\" align=\"center\" size=\"middle\"><!-- :size=\"200\" --></a-space>",
		],
		"description": "AntdVue间距代码片段"
	},
	"WpAntdVueIconSnippet": {
		"prefix": "w-icon",
		"body": [
			" <a-icon",
			"            type=\"setting\"",
			"            theme=\"twoTone\"",
			"            two-tone-color=\"#52c41a\"",
			"            spin",
			"            :rotate=\"180\"",
			"          />",
		],
		"description": "AntdVue图标代码片段"
	},
	"WpAntdVueDropdownButtonSnippet": {
		"prefix": "w-dropdown-button",
		"body": [
			"<a-dropdown-button",
			"        @click=\"handleButtonClick\"",
			"      >TestDropdown",
			"        <template",
			"          #overlay",
			"        ><a-menu>",
			"          <a-menu-item",
			"            @click=\"handleMenuClick\"",
			"            v-for=\"(item, index) in data\"",
			"            :key=\"index\"",
			"            :disabled=\"item.disabled\"",
			"          ><a-icon :type=\"item.type\" /> {{ item.content }}</a-menu-item",
			"          >",
			"        </a-menu></template",
			"        >",
			"        <template #icon> <a-icon type=\"setting\" theme=\"twoTone\" two-tone-color=\"#52c41a\" /></template>",
			"      </a-dropdown-button>",
		],
		"description": "AntdVue下拉菜单代码片段"
	},
	"WpAntdVuePaginationSnippet": {
		"prefix": "w-pagination",
		"body": [
			"<pagination",
			"          show-size-changer",
			"          showQuickJumper",
			"          v-model=\"currentPage\"",
			"          :page-size-options=\"pageSizeOptions\"",
			"          :default-current=\"1\"",
			"          :total=\"total\"",
			"          @change=\"onChange\"",
			"          @showSizeChange=\"onshowSizeChange\"",
			"        >",
			"          <template slot=\"buildOptionText\" slot-scope=\"props\">",
			"            <span v-if=\"props.value !== '500'\">{{ props.value }}条/页</span>",
			"            <span v-if=\"props.value === '500'\">全部</span>",
			"          </template>",
			"        </pagination>",
		],
		"description": "AntdVue分页代码片段"
	},
	"WpAntdVueStepsSnippet": {
		"prefix": "w-steps",
		"body": [
			"<a-steps",
			"          :current=\"currentStep\"",
			"          size=\"small\"",
			"          direction=\"horizontal\"",
			"          :status=\"status\"",
			"        ><!-- status:wait|process|finish|error -->",
			"          <a-step v-for=\"(item, index) in stepsData\" :key=\"index\">",
			"            <template #icon> <a-icon :type=\"item.type\" /></template>",
			"            <template #title> {{ item.title }} </template>",
			"            <template #description>{{ item.description }}</template>",
			"          </a-step>",
			"        </a-steps>",
			"        <!-- status: 'error', currentStep: 2, stepsData: [ { type: 'user', title: '标题1', description: '这里是步骤描述1',",
			"        content: '这是步骤1的内容' }, { type: 'solution', title: '标题2', description: '这里是步骤描述2', content:",
			"        '这是步骤2的内容' }, { type: 'loading', title: '标题3', description: '这里是步骤描述3', content:",
			"        '这是步骤3的内容' } ] -->",
		],
		"description": "AntdVue步骤条代码片段"
	},
	"WpAntdVueCascaderSnippet": {
		"prefix": "w-cascader",
		"body": [
			"<cascader",
			"          size:large",
			"          :options=\"options\"",
			"          :default-value=\"defaultValues\"",
			"          :show-search=\"{ filter }\"",
			"          placeholder=\"请选择位置\"",
			"          change-on-select",
			"          @change=\"onChange\"",
			"        ><template #suffixIcon> <a-icon type=\"setting\" theme=\"twoTone\" two-tone-color=\"#52c41a\" spin /></template>",
			"        </cascader>",
			"        <!--  import { Cascader } from 'ant-design-vue'",
			"        defaultValues: ['shandong', 'yantai'], options: [ { value: 'shandong',",
			"        label: '山东省', children: [ { value: 'yantai', label: '烟台市', children: [ { value: 'kaifaqu', label: '开发区'",
			"        }, { value: 'fushanqu', label: '福山区', disabled: true } ] }, { value: 'qingdao', label: '青岛市', children: [",
			"        { value: 'shinanqu', label: '市南区' }, { value: 'shibeiqu', label: '市北区' } ] } ] }, { value: 'beijing',",
			"        label: '北京市', children: [ { value: 'dongchengqu', label: '东城区' }, { value: 'xichengqu', label: '西城区' }",
			"        ] } ]",
			"        onChange (val, selectedOptions) { console.log(...val, selectedOptions) },",
			"        filter (inputValue, path) {",
			"        return path.some((option) => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1) } -->",
		],
		"description": "AntdVue级联选择器代码片段"
	},