Coder Social home page Coder Social logo

我在引入 npm install -save @types/cesium后,出现错误Module parse failed: Unexpected character '#' (1:0) about vue-typescript-admin-template HOT 8 CLOSED

armour avatar armour commented on May 15, 2024
我在引入 npm install -save @types/cesium后,出现错误Module parse failed: Unexpected character '#' (1:0)

from vue-typescript-admin-template.

Comments (8)

Armour avatar Armour commented on May 15, 2024

请给一个可以复现错误的最小repo 谢谢

from vue-typescript-admin-template.

zhangjinghuan avatar zhangjinghuan commented on May 15, 2024
<script lang='ts'> import { Component, Vue } from 'vue-property-decorator'; // 导入Cesium源码中的Viewer组件,注意这里是用的Viewer组件的方式加载,而不是加载整个Cesium import {Viewer} from 'cesium' import 'cesium/Source/Widgets/widgets.css' // 如何让Cesium知道静态资源在哪里的API import {buildModuleUrl} from 'cesium' export default { name: 'cesiumContainer', mounted: function() { // 设置静态资源目录 buildModuleUrl.setBaseUrl('static/Cesium/') // 创建viewer实例 new Viewer('cesiumContainer') }, data() { return { viewer: {} } } } </script> <style rel="stylesheet/scss" lang="scss" scoped> </style>

from vue-typescript-admin-template.

zhangjinghuan avatar zhangjinghuan commented on May 15, 2024

模板是:
// template
// div class="wscn-http404-container" id="cesiumContainer"
// /div
// /template

ts是:

<script lang='ts'> import { Component, Vue } from 'vue-property-decorator'; // 导入Cesium源码中的Viewer组件,注意这里是用的Viewer组件的方式加载,而不是加载整个Cesium import {Viewer} from 'cesium' import 'cesium/Source/Widgets/widgets.css' // 如何让Cesium知道静态资源在哪里的API import {buildModuleUrl} from 'cesium' export default { name: 'cesiumContainer', mounted: function() { // 设置静态资源目录 buildModuleUrl.setBaseUrl('static/Cesium/') // 创建viewer实例 new Viewer('cesiumContainer') }, data() { return { viewer: {} } } } </script>

from vue-typescript-admin-template.

Armour avatar Armour commented on May 15, 2024

给个repo吧。。。 这个代码贴的也太乱了。。

from vue-typescript-admin-template.

zhangjinghuan avatar zhangjinghuan commented on May 15, 2024

default

from vue-typescript-admin-template.

zhangjinghuan avatar zhangjinghuan commented on May 15, 2024

@Armour 总共几行代码 记得先npm install -save @types/cesium

from vue-typescript-admin-template.

Armour avatar Armour commented on May 15, 2024

给个repo吧。。。 你这个截图我不想手动打一遍。。 谢谢

from vue-typescript-admin-template.

Armour avatar Armour commented on May 15, 2024

Closed due to inactivity.

from vue-typescript-admin-template.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.