dext7r / vue-amis-sdk

基于amis-editor封装的vue版本,支持vue2,vue3
https://github.com/h7ml/vue-amis-sdk-examples
Apache License 2.0
34 stars 4 forks source link

vue空工程安装vue-amis-sdk依赖后,运行异常 #77

Closed meloonly closed 1 year ago

meloonly commented 1 year ago
{
  "name": "vue-amis-project",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build"
  },
  "dependencies": {
    "@fortawesome/fontawesome-free": "^6.2.1",
    "core-js": "^3.6.5",
    "vue": "^2.6.11",
    "vue-amis-sdk": "^2.2.0",
    "vuera": "^0.2.7"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.19",
    "@vue/cli-service": "~4.5.19",
    "vue-template-compiler": "^2.6.11"
  }
}

// fortawesome import "@fortawesome/fontawesome-free/css/all.css"; import "@fortawesome/fontawesome-free/js/all"; import VueAmisSdk from "vue-amis-sdk"; import { VuePlugin } from "vuera";

Vue.use(VueAmisSdk); Vue.use(VuePlugin);

Vue.config.productionTip = false

new Vue({ render: h => h(App), }).$mount('#app')

- App.vue
```vue
<template>
  <div id='app'>
    <vue-amis-sdk
      id='editorName'
      theme='cxd'
      className='is-fixed'
      :preview='isPreview'
      :isMobile='isMobile'
      @onChange='onChange'
      :value='schema'
    />
  </div>
</template>
<script>
import "amis-ui/lib/themes/cxd.css";
import "amis-ui/lib/themes/ang.css";
import "amis-editor/dist/style.css";
export default {
  name: 'App',
  data() {
    return {
      isPreview: false,
      isMobile: false,
      schema: {}
    }
  },
  methods: {
    onChange(e) {
      console.log(e)
    }
  }
}
</script>

执行完yarn && yarn serve后,项目可以正常启动,但控制台报了个异常: image

h7ml commented 1 year ago

amis-sdk-vue 降级到2.1.0的版本

h7ml commented 1 year ago

使用最新版 https://github.com/h7ml/vue-amis-sdk-examples/blob/main/package.json#L14