五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

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

Vue與element聯(lián)動踩過的坑

2021-05-08 15:26 作者:忘魂兒  | 我要投稿

vue最新版本中創(chuàng)建的實例對象是createApp

而我們正常按照官方文檔進行安裝的element-ui,只支持實例對象為Vue

所以問題就出在了這里

如果你的實例對象是Vue的話,

vue create my-app

cd?my-app

vue add element

然后再在main.js中引入即可

import Vue from 'vue';

import ElementUI from 'element-ui';

import 'element-ui/lib/theme-chalk/index.css';

import App from './App.vue';?

Vue.use(ElementUI);

new Vue({ el: '#app', render: h => h(App) });

如果你的實例對象是createApp,

我看別的大佬都教你降低版本,讓你卸載,安一個兼容的版本

我就不一樣了直接用element-plus的方法來引入element-ui就好了嘛

vue create my-app

cd?my-app

vue add element-plus

npm install vue-cli-plugin-element-plus

在main.js中

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import 'element-ui/lib/theme-chalk/index.css'
import installElementPlus from './plugins/element'

const app = createApp(App)
installElementPlus(app)
app.use(store).use(router).mount('#app')

下面我以走馬燈(輪播圖示例如何使用)

<template>
<div id="swiper">
?<el-carousel height="300px" id="imgs">
? ?<el-carousel-item ?v-for="(item,index) in banners" :key="index">
? ? ?<a :href="item.link">-->
? ? ? ? ? ?<img :src="item.image" alt="">
? ? ?</a>
? ?</el-carousel-item>
?</el-carousel>
</div>
</template>


好了,散會!

Vue與element聯(lián)動踩過的坑的評論 (共 條)

分享到微博請遵守國家法律
巴楚县| 百色市| 于田县| 桓台县| 奉新县| 桐庐县| 卢龙县| 连山| 阆中市| 玉溪市| 桦川县| 香港 | 方正县| 孝感市| 黎川县| 克东县| 游戏| 宜都市| 翁牛特旗| 义马市| 临猗县| 海口市| 台安县| 威信县| 霞浦县| 钟祥市| 巫山县| 丰镇市| 阳新县| 林口县| 凤山县| 尚义县| 稷山县| 靖西县| 台东市| 札达县| 长海县| 九寨沟县| 和政县| 驻马店市| 西城区|