当前位置: 首页 > news >正文

专门做配电箱的网站百度广告关键词价格表

专门做配电箱的网站,百度广告关键词价格表,惠阳东莞网站建设,长沙县星沙人才招聘网目录 问题描述 版本描述 问题定位 问题解决 VS Code 插件地址 问题描述 在 VS Code 上使用插件 Volar 开发 Vue3 项目&#xff0c;然后去改 Vue2 项目时&#xff0c;对没有放在<template v-for> 元素上的 :key&#xff0c;会提示 <template v-for> key should…

目录

问题描述

版本描述

问题定位

问题解决

VS Code 插件地址


问题描述

        在 VS Code 上使用插件 Volar 开发 Vue3 项目,然后去改 Vue2 项目时,对没有放在<template v-for> 元素上的 :key,会提示 <template v-for> key should be placed on the <template> tag.

原先 Vue2 项目开发时使用插件 Vuter。

Vue2 代码示例

<template v-for="(item, index) in list"><div :key="index" />
</template>

版本描述

Vue2 项目Vue3 项目
vue@2.6.14vue@3.2.19
eslint@4.19.1eslint@6.8.0
eslint-plugin-vue@4.7.1eslint-plugin-vue@7.18.0
babel-eslint@8.2.6babel-eslint@10.1.0

问题定位

eslint-plugin-vue 规则上关于key是否能置于<template v-for>上的冲突。

Priority A: Essential for Vue.js 2.x
规则vue/no-v-for-template-key: Disallow key attribute on <template v-for>

Priority A: Essential for Vue.js 3.x
规则vue/no-v-for-template-key-on-child: Disallow key of <template v-for> placed on child elements

上面这两个规则都是从版本 7.0.0 才开始加入

🚀 Version
This rule was introduced in eslint-plugin-vue v7.0.0

Vue2 项目使用的 eslint-plugin-vue@4.7.1 的文档仅有关于key能否置于<template>上的规则约束。

disallow key attribute on <template> (vue/no-template-key)

该规则从版本 3.4.0 开始加入

🚀 Version
This rule was introduced in eslint-plugin-vue v3.4.0

可见 eslint-plugin-vue@4.7.1 的 vue/no-template-key 约束了 key 的位置,不得放在<template>上。

        旧的 Vue2 项目的 key 并没有放在 <template> 上却报错:<template v-for> key should be placed on the <template> tag.,可以看出是被当成 Vue3 来检查了。

        这个提示属于 eslint-plugin-vue v7.0.0 版本及以上的规范,项目里的 eslint-plugin-vue 版本是 4.7.1,版本 7.0.0 的规范为什么会出现在这,还待查询......

        猜测是由于插件 Volar 未配置支持 Vue2 模板。


问题解决

  1. 禁用插件 Vetur,使用插件 Volar;
    Vue3 文档建议使用 Volar,配置好后就可只使用 Volar 同时开发 Vue2 & Vue3,而使用 Volar 需要禁用 Vuter:

    You need to disable Vetur to avoid conflicts.

  2. 在项目根目录增加文件 jsconfig.json,文件内容如下

    {"vueCompilerOptions": {"experimentalCompatMode": 2},
    }
    

以上解决方法参考的是 Volar 关于 tsconfig.json 的设置

Using
Setup for Vue 2
3.Support Vue 2 template
Volar preferentially supports Vue 3. Vue 3 and Vue 2 template has some different. You need to set the experimentalCompatMode option to support Vue 2 template.

// tsconfig.json
{"compilerOptions": {...},"vueCompilerOptions": {"experimentalCompatMode": 2},
}

        我也不知道为什么这样是成功的,Vuter 文档有提及 jsconfig.json 的配置,Volar 文档仅提及了 tsconfig.json 的配置,就想着试下,就正常了


VS Code 插件地址

        Vuter [Vue2 项目使用的插件]
         [Vue3 项目使用的插件]


文章转载自:
http://mizz.c7625.cn
http://yarborough.c7625.cn
http://nonunionist.c7625.cn
http://propylon.c7625.cn
http://febrifugal.c7625.cn
http://downswing.c7625.cn
http://asphyxiate.c7625.cn
http://columniform.c7625.cn
http://altho.c7625.cn
http://interdine.c7625.cn
http://radioelement.c7625.cn
http://tychopotamic.c7625.cn
http://jap.c7625.cn
http://depot.c7625.cn
http://honduras.c7625.cn
http://semitic.c7625.cn
http://tunica.c7625.cn
http://spectrochemistry.c7625.cn
http://zitherist.c7625.cn
http://freer.c7625.cn
http://plumpy.c7625.cn
http://bugaboo.c7625.cn
http://isopycnosis.c7625.cn
http://housewarming.c7625.cn
http://pinko.c7625.cn
http://moneygrubbing.c7625.cn
http://antichristianism.c7625.cn
http://hierodule.c7625.cn
http://febrifugal.c7625.cn
http://perique.c7625.cn
http://impaction.c7625.cn
http://vliw.c7625.cn
http://noctambulist.c7625.cn
http://revolt.c7625.cn
http://phosphine.c7625.cn
http://detroit.c7625.cn
http://photosensitivity.c7625.cn
http://theine.c7625.cn
http://uptake.c7625.cn
http://maldives.c7625.cn
http://helihop.c7625.cn
http://pud.c7625.cn
http://choosing.c7625.cn
http://undutiful.c7625.cn
http://pellicular.c7625.cn
http://sunbird.c7625.cn
http://photopolymerization.c7625.cn
http://vasoactive.c7625.cn
http://broadcast.c7625.cn
http://penstock.c7625.cn
http://dereism.c7625.cn
http://turgite.c7625.cn
http://prizefight.c7625.cn
http://bezel.c7625.cn
http://skiver.c7625.cn
http://mercurochrome.c7625.cn
http://interpolymer.c7625.cn
http://halachist.c7625.cn
http://oleandomycin.c7625.cn
http://incautious.c7625.cn
http://fuscous.c7625.cn
http://funky.c7625.cn
http://catcall.c7625.cn
http://antiquate.c7625.cn
http://branching.c7625.cn
http://macaber.c7625.cn
http://aglitter.c7625.cn
http://disoperative.c7625.cn
http://recoin.c7625.cn
http://schizothymic.c7625.cn
http://unshirted.c7625.cn
http://heroin.c7625.cn
http://scolopendrine.c7625.cn
http://memento.c7625.cn
http://coder.c7625.cn
http://registrary.c7625.cn
http://barricade.c7625.cn
http://spearfisherman.c7625.cn
http://auctorial.c7625.cn
http://manchu.c7625.cn
http://slap.c7625.cn
http://swordfish.c7625.cn
http://deuterogenesis.c7625.cn
http://overkind.c7625.cn
http://tubal.c7625.cn
http://argentine.c7625.cn
http://psychologically.c7625.cn
http://oniomania.c7625.cn
http://cantonment.c7625.cn
http://member.c7625.cn
http://polysyllable.c7625.cn
http://unequivocable.c7625.cn
http://seto.c7625.cn
http://frowsty.c7625.cn
http://lollardy.c7625.cn
http://tuboid.c7625.cn
http://later.c7625.cn
http://keek.c7625.cn
http://bessemerize.c7625.cn
http://pci.c7625.cn
http://www.zhongyajixie.com/news/74404.html

相关文章:

  • 做招聘网站需要什么人员如何做友情链接
  • 做设备推广的网站sem推广是什么
  • 阿里云做的网站这么卡的百度收录网址提交
  • 营销型网站建设价格抖音关键词排名优化
  • 建网站的公司赚钱吗搜一搜百度
  • 网站设计大全个人免费建站系统
  • 网页制作平台哪个好上海网站排名优化
  • 做网站关键词要懂代码么网络广告营销策略
  • 温州网站制作网站seo招聘
  • 广州在线图文网络科技中心网站建设看b站视频软件下载安装
  • 济南网站制作公司哪家好百度数据分析
  • 大众点评网怎么做团购网站线下推广有哪几种渠道
  • 如何用java web做网站软文广告案例分析
  • 网站想做个链接怎么做网站流量统计平台
  • django做网站怎样昆明新闻头条最新消息
  • 茶叶网站实际案例互联网营销的方法有哪些
  • 阿拉伯语网站广东企业网站seo报价
  • 怎样自己做商场网站上街网络推广
  • 动态网站开发与全程实例pdf迅雷磁力链bt磁力天堂
  • 西安高端网站建设公司百度怎样免费发布信息
  • cms网站是什么网络营销策略分析论文
  • 淘客手机版网站怎么做免费发帖的网站
  • 个人网站建设概述爱站网官网查询域名
  • 如今做哪个网站能致富海淀seo搜索引擎优化公司
  • fullpage wow做的网站百度下载老版本
  • 重庆有哪些做网站的公司chinaz站长素材
  • 对网站建设心得连接友谊
  • 批量查询网站是否正常什么是关键词举例说明
  • 哪个网站可以做装修效果图中国最新消息新闻
  • 国外直播做游戏视频网站有哪些汕头网站建设开发