Skip to content

Commit 8ad1b13

Browse files
committed
完善说明
1 parent 487d2bd commit 8ad1b13

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,37 @@
55
基于EarthSDK、webpack和vue创建的极简App,可以调试和打包。
66
其中Vue以独立的js文件从外部引入。
77

8+
![预览](tools/images/preview.jpg)
9+
10+
注意:小项目可以使用这种方式,比较省事,大型项目最好用Earth-webapck-vue-App或者Earth-vue-cli-App这两个项目来构建。
11+
12+
这个项目的缺点是,vue组件的创建,不能直接写xxx.vue文件,需要用js方式书写,类似下面这种形式:
13+
14+
```
15+
// 1 创建Earth的vue组件
16+
var EarthComp = {
17+
template: `
18+
<div style="width: 100%; height: 100%">
19+
<div ref="earthContainer" style="width: 100%; height: 100%">
20+
</div>
21+
<div style="position: absolute; left: 18px; top: 18px">
22+
<button>{{ message }}</button>
23+
</div>
24+
</div>
25+
`,
26+
data() {
27+
return {
28+
message: '页面加载于 ' + new Date().toLocaleString(),
29+
_earth: undefined, // 注意:Earth和Cesium的相关变量放在vue中,必须使用下划线作为前缀!
30+
_bgImagery: undefined,
31+
};
32+
},
33+
// ...
34+
}
35+
36+
export default EarthComp;
37+
```
38+
839
## 使用方法
940

1041
0. 安装

0 commit comments

Comments
 (0)