国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

jsx的使用方法

2021-07-31 22:40 作者:忘魂兒  | 我要投稿


## jsx的基本使用
### jsx的babel配置
#### 安裝Babel支持Vue的jsx插件:
npm install @vue/babel-plugin-jsx -D
#### 在babel.config.js配置文件中配置插件:
module.exports = {
 ?presets: [
 ? ?'@vue/cli-plugin-babel/preset',
 ?
 ? ],
 ? plugins:[
 ? ? "@vue/babel-plugin-jsx"
 ? ]
}
### jsx組件的使用
import jsxOn from './jsxOn.vue'
import {ref} from 'vue'
export default {
 ? ?setup(){
 ? ? ? ?const count=ref(0)
 ? ? ? ?const on=()=>{
 ? ? ? ? this.count++
 ? ? ? ?}
 ? ? ? ?return {
 ? ? ? ? ? ?count,
 ? ? ? ? ? ?on
 ? ? ? ?}
 ? ?}
 ? ?render() {
 ? ? ?return (
 ? ? ? ? ?<div>
 ? ? ? ? ? ?<h2>{this.count}</h2>
 ? ? ? ? ? ?<button onClick={this.on}>+1</button>
 ? ? ? ? ? ?<jsxOn>{{default2: props=><div>我是jsxOn的插槽</div>}}</jsxOn>
 ? ? ? ? ?</div>
 ? ? ?);
 ?},
}


jsx的使用方法的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
黔江区| 辽宁省| 平乡县| 岐山县| 南京市| 高安市| 双城市| 山阴县| 墨玉县| 藁城市| 改则县| 南雄市| 乐安县| 衡阳县| 乾安县| 榆中县| 太康县| 交口县| 元谋县| 高唐县| 高尔夫| 大新县| 准格尔旗| 佛教| 随州市| 望都县| 天门市| 翁源县| 那坡县| 赞皇县| 彭州市| 健康| 禹城市| 建水县| 依安县| 唐海县| 商河县| 卢龙县| 会宁县| 故城县| 祁门县|