重现步骤
1.新建项目
2.选择uni-app项目
3.模板 空项目
4.npm init -y
5.npm install raphael --save
6.修改 pages/index/index.vue
<template>
<view>
<view id="map"></view>
</view>
</template>
<script>
import rap from "raphael"
export default {
data() {
return {
title: 'Hello'
}
},
mounted() {
let paper = rap('map', 100, 100);
let rect = paper.rect(0, 0, 100, 100);
rect.attr({
'fill': '#F5F3F0',
'stroke': '#F5F3F0'
});
}
}
</script>
7.运行到浏览器
使用HBuilderX 1.4.1.20181228 版本的时候正常
使用HBuilderX 1.5.2.20190121 版本的时候报错
bootstrap:887 ReferenceError: eve is not defined
at raphael.min.js:2
at Object.<anonymous> (raphael.min.js:2)
at e (raphael.min.js:1)
at Object.<anonymous> (raphael.min.js:1)
at e (raphael.min.js:1)
at Object.<anonymous> (raphael.min.js:1)
at e (raphael.min.js:1)
at raphael.min.js:1
at raphael.min.js:1
at t (raphael.min.js:1)
__webpack_require__.oe @ bootstrap:887
Promise.catch (async)
(anonymous) @ pages.json:10
resolveAsyncComponent @ vue.runtime.esm.js:2389
createComponent @ vue.runtime.esm.js:4289
_createElement @ vue.runtime.esm.js:4500
createElement @ vue.runtime.esm.js:4437
vm.$createElement @ vue.runtime.esm.js:4572
render @ pages.json:51
Vue._render @ vue.runtime.esm.js:4624
updateComponent @ vue.runtime.esm.js:2829
get @ vue.runtime.esm.js:3201
Watcher @ vue.runtime.esm.js:3189
mountComponent @ vue.runtime.esm.js:2836
./node_modules/@dcloudio/vue-cli-plugin-uni/packages/h5-vue/dist/vue.runtime.esm.js.Vue.$mount @ vue.runtime.esm.js:8098
init @ vue.runtime.esm.js:4207
createComponent @ vue.runtime.esm.js:5686
createElm @ vue.runtime.esm.js:5633
patch @ vue.runtime.esm.js:6170
Vue._update @ vue.runtime.esm.js:2708
updateComponent @ vue.runtime.esm.js:2829
get @ vue.runtime.esm.js:3201
Watcher @ vue.runtime.esm.js:3189
mountComponent @ vue.runtime.esm.js:2836
./node_modules/@dcloudio/vue-cli-plugin-uni/packages/h5-vue/dist/vue.runtime.esm.js.Vue.$mount @ vue.runtime.esm.js:8098
init @ vue.runtime.esm.js:4207
createComponent @ vue.runtime.esm.js:5686
createElm @ vue.runtime.esm.js:5633
createChildren @ vue.runtime.esm.js:5761
createElm @ vue.runtime.esm.js:5662
patch @ vue.runtime.esm.js:6170
Vue._update @ vue.runtime.esm.js:2708
updateComponent @ vue.runtime.esm.js:2829
get @ vue.runtime.esm.js:3201
Watcher @ vue.runtime.esm.js:3189
mountComponent @ vue.runtime.esm.js:2836
./node_modules/@dcloudio/vue-cli-plugin-uni/packages/h5-vue/dist/vue.runtime.esm.js.Vue.$mount @ vue.runtime.esm.js:8098
init @ vue.runtime.esm.js:4207
createComponent @ vue.runtime.esm.js:5686
createElm @ vue.runtime.esm.js:5633
patch @ vue.runtime.esm.js:6209
Vue._update @ vue.runtime.esm.js:2708
updateComponent @ vue.runtime.esm.js:2829
get @ vue.runtime.esm.js:3201
Watcher @ vue.runtime.esm.js:3189
mountComponent @ vue.runtime.esm.js:2836
./node_modules/@dcloudio/vue-cli-plugin-uni/packages/h5-vue/dist/vue.runtime.esm.js.Vue.$mount @ vue.runtime.esm.js:8098
E:\Learn\uni-app\uni-app-laphael-demo\main.js @ main.js:12
__webpack_require__ @ bootstrap:766
fn @ bootstrap:129
0 @ log.js:47
__webpack_require__ @ bootstrap:766
(anonymous) @ bootstrap:901
(anonymous) @ bootstrap:901
vue.runtime.esm.js:593 [Vue warn]: Failed to resolve async component: function (resolve) {
var component = {
component: Promise.all(/*! require.ensure | pages-index-index */[__webpack_require__.e("vendors~pages-index-index"), __webpack_require__.e("pages-index-index")]).then((function () {return resolve(__webpack_require__(/*! E:/Learn/uni-app/uni-app-laphael-demo/pages/index/index */ "E:\\Learn\\uni-app\\uni-app-laphael-demo\\pages\\index\\index.vue"));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe),
delay: __uniConfig['async'].delay,
timeout: __uniConfig['async'].timeout };
if (__uniConfig['async']['loading']) {
component.loading = {
name: 'SystemAsyncLoading',
render: function render(createElement) {
return createElement(__uniConfig['async']['loading']);
} };
}
if (__uniConfig['async']['error']) {
component.error = {
name: 'SystemAsyncError',
render: function render(createElement) {
return createElement(__uniConfig['async']['error']);
} };
}
return component;
}
Reason: ReferenceError: eve is not defined
0 个回复