Coder Social home page Coder Social logo

incubator-weex-loader's Introduction

Weex Loader

A webpack loader for Weex.

Install

npm install weex-loader babel-loader --save

Features

  1. Can load .we file.
  2. Can load parted files(.js/.css/.html) via src attribute.
  3. Can specify a custom language to chain any loader.
  4. Can specify name when require .we file.
  5. Can write es2015 in script.

Upgrade to v0.3

  • Use a different way to load parted files. The old way is deprecated.
  • If you dependent weex-components under v0.1, please update it to v0.2.
  • Just enjoy the new features!
  • Use some hack way to require @weex-module/xxxx in .js file. see issue

Usage

How to load a .we file.

make a webpack config

module.exports = {
  entry: './main.we?entry',
  output: {
    path: './dist',
    filename: 'main.js'
  },
  module: {
    loaders: [
      {
        test: /\.we(\?[^?]+)?$/,
        loader: 'weex'
      }
    ]
  }
};

How to write parted files

specify src attribute

<template src="./main.html"></template>
<style src="./main.css"></style>
<script src="./main.js"></script>

add some custom language for loaders

append a weex config in webpack config

  weex: {
    lang: {
      jade: ['jade-html'] // a jade langauge will chain "jade-html-loader"
    }
  }

main.we

<template lang="jade">
div
  text Hello Weex
</template>

How to require .we file as component element

  1. first, require a path/to/component.we in script like require('./foo.we') or write inline element like <element name="foo" src="./foo.we"></element>.
  2. second, use it in template like <foo></foo>.
<element name="foo" src="./foo.we"></element>

<template>
  <div>
    <foo></foo>
    <bar></bar>
  </div>
</template>

<script>
  require('./bar.we')
</script>

How to specify the name of a component

  1. By default, the name is the basename without extname of component path.
  2. Give a name query in require request, like require('./foo.we?name="fooo"'). Or specify a name attribute in element, like <element name="fooo" src="./foo.we" ></element>
  3. use the name in template like <fooo></fooo>.
<element name="fooo" src="./foo.we"></element>

<template>
  <div>
    <fooo></fooo>
    <baar></baar>
  </div>
</template>

<script>
  require('./bar.we?name=baar')
</script>

Test

npm run test

will run mocha testing.

And you can check the specs in test/spec folder.

Specs

Knew Issues

incubator-weex-loader's People

Contributors

balloonzzq avatar caijiehong avatar cnryb avatar daxingplay avatar dickeylth avatar erha19 avatar exolution avatar hanks10100 avatar jinjiang avatar songsiqi avatar terrykingcha avatar willemjiang avatar wrmswindmill avatar yorkshen avatar zhuangzaiqian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

incubator-weex-loader's Issues

[bug][email protected]无法加载独立css文件

先前版本的weex-loader(v0.2.3)能够正确加载独立css文件,而0.3.0-alpha在处理过程中 会提示 template区块找不到,然后就无法正确输出js文件了,忘排查解决,谢谢!

不能像 vue-loader 那样自动加载 postcss 的配置文件?

postcss 是可以通过 .postcssrc.js 或者 postcss.config.js 配置参数的
参考:
https://github.com/postcss/postcss-loader#configuration
https://github.com/michael-ciniawsky/postcss-load-config

vue-loader 也是支持配置文件的:
https://vue-loader.vuejs.org/zh-cn/features/postcss.html

我将 postcss 插件配置在 .postcssrc.js 中,vue-loader 可以正确读取,但 weex-loader 一定要配置在 webpack loader 的 options 中才生效

How to use scss And vue-i18n in weex-loader

There is no problem using stylus
in .vue

<style lang='stylus'>

in webpack.conf.js

{
      test: /\.vue$/,
      loader: loader + '-loader'  // loader will be 'vue' or 'weex'
}

seems it will auto find stylus-loader
but scss use sass-loader , how to alias it?

And how to use vue-i18n?
the vue way is

{
      test: /\.vue$/,
      loader: 'vue-loader',
     options: {
         loaders: {
             i18n: '@kazupon/vue-i18n-loader'
         }
     }
}

Thanks

[BUG] weex-loader 0.7.2 sass 变量支持有问题

sass 中变量的写法原来项目中没有问题,现在项目中会报Selector $base-color: #1da1f2;
.header is not supported. Weex only support single-classname selector

code:

<style lang="sass" scoped>
$base-color: #1da1f2;

.header {
  padding-top: 45px;
  width: 750px;
  height: 117px;
  background-color: $base-color;
  color: #FFFFFF;
}

</style>

在 0.5.x的版本,是支持此写法的。

希望支持js引入样式和脚本

虽然按照组件的划分,是样式与脚本聚合的形态,但是还是要考虑代码的易维护性

目前写模板都必须得script/style/tempalte三个标签写在一个模板文件里面,很难保证后续因为style/script的内容庞大而导致整个文件难以维护,查阅起来都是一个麻烦事情,建议支持物理分离的功能,比如

<template>

.....
</template>

<script>
     export from './index.css'
     export from './index.js'
</script>

[Proposal] A more robust way to distinguish the type of the bundle

weex-loader support both Weex and Vue now, it should also offer a way to distinguish the bundle type.

Currently, Weex is using a banner comment to distinguish the type of the bundle, and find the corresponding framework to create instance. It's neither elegant nor robust.

I think we should offer a function (e.g. getWeexBundleType) or a global variable (e.g. WEEX_BUNDLE_TYPE) to get the type of current bundle.

Doesn't work with other loaders ?

Doesn't work with other loaders like: string-replace-loader.

Webpack config file:

use: [
  {
    loader: 'weex-loader',
  },
  {
    loader: 'string-replace-loader',
    query: {
      search: 'old-var-name',
      replace: 'new-var-name',
    },
  },
],

Hot Module Replacement?

I have a pretty technical pickle I've waded myself into. I've gotten myself in an insane project of trying to get hot loading working in Weex. I'm so close I can taste it - but I'm missing something fundamental and I've already spent more time than I can justify. The steps I've already done:

  1. Patched an existing ObjC eventsource client to support HMR (It didn't work with large frames. sigh).

  2. Created a "Weex" target mode for Webpack (by cloning the webworker target and changing things around to use the stream.fetch() mechanism) so that the webpack modules can fetch things reasonably.

  3. Created a weex-aware HMR client (pretty easy, if you throw away all checks & safety)

  4. Created a layer on top of the weex-loader that turns on hot reloading on a per-file basis

  5. Copypasta'd vue-hot-reload-api, and am trying to modify it to work. I'm stuck trying to understand what's going on here:

if (version[1] < 2) {
  // preserve pre 2.2 behavior for global mixin handling
  record.Ctor.extendOptions = options
}

var newCtor = record.Ctor.super.extend(options);
// var newCtor = Vue.extend(options)

record.Ctor.options = newCtor.options

I don't understand the "pre 2.2 behavior" note, and I cant find any references to extendOptions in the docs. I also don't understand why the super.extend( call doesn't work - the render call in newCtor.options afterwards is the same as record.Ctor, not the same as options.render. What's going on? What am I missing? How soon is someone competent going to add hot-module-replacement-aware Weex support?

It occurs to me after sleeping on it, that part of the issue could be that I'm using the version of the WeexSDK that ships with weex-hackernews, and not the latest (presumably newer versions of WeexSDK come with more modern versions of Vue).

关于 jade/pug 的一个疑问

为什么只能使用 jadejade-html-loader
使用 pugpug-loader 会显示空白?

weex: {
  lang: {
    pug: ['pug'],
    jade: ['pug'],
    stylus: ['stylus?sourceMap'],
  },
},

0.4.x版本因loadBabelModule打包错误

如题,loadBabelModule的实现在某些情况下会出现以下错误(出错环境: mac, node v8.0.0, npm v5.0.3),

img

const defaultLoaders = {
  none: '',
  main: path.resolve(loaderPath, 'loader.js'),
  extract: path.resolve(loaderPath, 'extract.js'),
  template: path.resolve(loaderPath, 'template.js'),
  style: path.resolve(loaderPath, 'style.js'),
  script: path.resolve(loaderPath, 'script.js'),
  json: path.resolve(loaderPath, 'json.js'),
  babel: loadBabelModule('babel-loader')
}

function loadBabelModule (moduleName) {
  try {
    const filePath = require.resolve(moduleName)
    return filePath.slice(0, filePath.lastIndexOf(moduleName) + moduleName.length)
  } catch (e) {
    return moduleName
  }
}

...

loaders.push({
  name: defaultLoaders.babel,
  query: {
    presets: [loadBabelModule('babel-preset-es2015')],
    plugins: [loadBabelModule('babel-plugin-transform-runtime')],
    comments: 'false'
  }
})

此处为什么特意写了一个loadBabelModule, 而不直接使用字符串? @exolution @terrykingcha

refer: weexteam/weex-loader@76cf603

`exports.xxx` doesn't work

exports.data = { ... }

will be converted into:

__weex_define__("@weex-component/xxx", [], function(__weex_require__, __weex_exports__, __weex_module__){
  exports.data = { ... }
  __weex_module__.exports.template = ...
  __weex_module__.exports.style = ...
})
__weex_bootstrap__("@weex-component/xxx", ...)

The exports.data won't match __weex_exports__

weex-loader计算容器高度有误

同样的内容,通过weex-loader和weex-toolkit编译出来产出的内容容器高度是不一致的,weex-toolkit编译产出高度符合预期,能正常滚动;weex-loader编译产出高度偏差严重,导致内容高度低于外层容器高度而不能滚动。

[Proposal] Support original `define` and `require`

Currently, weex-loder will generate __weex_define__ instead of the original define. But the old version of weex js framework doesn't support this variable.

  • __weex_define__ is supported since v0.13.8.
  • __weex_bootstrap__ is supported since v0.13.8.
  • __weex_require__ is supported since v0.15.3.

The js bundle generated by weex-loader couldn't run on js framework below v0.13.8. This problem should be fixed to improve the compatibility.

style标签在引用公共css的同时,如何在we文件中再自定义一些style样式

0.2.*版本的时候,可以一下通过这种方式引用公共的css样式,同时还可以继续写<style></style>定义一些内部样式。

<script>
    require('weex-components');
    module.exports = {
        style: require('../css/common.css'),
    ...

现在升级成了0.3.1后,虽然可以通过<style src="./css/common.css"></style>引用外部样式文件,但没法同时再在we文件中定义<style></style>的样式了,试了很多办法,都没法将外部css和内部css共存。
请问有什么办法可以实现我说的这种需求吗?

this.options nolonger support in webpack 4

in src/loader.js line 205, this.options nolonger support in webpack 4.
it will come up as undefined and go error.
same bug in weex-vue-loader
`
const options = this.options.weex || {}

`
replace by

const options = this._compiler.options.weex || {}
this will work in webpack 4 and older version

自定义脚手架用webpack打包时出现Cannot resolve module 'babel-loader'

为了不再开发环境生成冗余的node_modules,我们在开发环境的目录下

/Users/lvdada/Desktop/WorkGit/showjoy-assets/shop-m/src/pages/shop-info

执行自定义的打包工具命令spon build,打包工具的目录层级为以下:

/Users/lvdada/.spon/plugins/local/spon-weex

在打包工具的环境中都已经安装了必要的weex-loader,babel-loader等,但是执行打包编译的过程中出现找不到babel-loader的错误

ERROR in ./src/pages/shop-info/shop-info.we?entry=true
Module not found: Error: Cannot resolve module 'babel-loader' in /Users/lvdada/Desktop/WorkGit/showjoy-assets/shop-m/src/pages/shop-info
 @ ./src/pages/shop-info/shop-info.we?entry=true 2:22-553

在打包工具环境中已经对weex-loader的路径做了处理,让打包工具可以在打包工具所在的目录层级中寻找loader。

webpackConfig.module.loaders.push({
      test: /\.we(\?[^?]+)?$/,
      loader: require.resolve('weex-loader')
    })

请问我该如何解决找不到babel-loader的错误?

支持多个 <style> 标签

目前如果存在多个 <style> 标签只有第一个生效,希望能够支持多个 <style> 的样式同时生效,靠后的样式会覆盖前面的。

考虑添加这个功能的原因是:

方便多个组件共享样式

目前 <style> 标签支持 src 属性,能够从 CSS 文件读取样式。不过使用 src 属性后,内部定义的样式会被忽略(这个特性没有问题)。如果想实现多个组件能使用公共样式,可以有如下写法:

<style src="../css/common.css"></style>

<style>
  .specific {
    font-size: 66
  }
</style>

能针对平台写样式

可以实现针对不同平台、横竖屏幕写样式。目前 weex 没有这个功能,后期会考虑加入这种特性。

<style platform="desktop">
  .banner {
    height: 80;
  }
</style>

<style platform="mobile" orientation="portrait">
  .banner {
    font-size: 45;
  }
</style>

<style platform="tablet" orientation="landscape">
  .banner {
    color: blue;
  }
</style>

cannot compile `we` file type in `node_modules`

When I npm run dev & npm run serve in my project, it return message below, which there seems to be somethings wrong.

    ERROR in ./~/weex-chart/chart.we
    Module parse failed: /Users/NoraChan/Desktop/geekhacker.tech/datahub_weex/node_modules/weex-chart/chart.we Unexpected token (4:0)
    You may need an appropriate loader to handle this file type.
    | * Created by godsong on 16/11/3.
    | */
    | <template>
    |     <gcanvas id="wxc_gcanvas" style="width:{{width}};height:{{height}};background-color:#ffffff"></gcanvas>
    | </template>
     @ ./~/weex-chart/index.js 4:0-21
     @ ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./src/components/pivot.vue
     @ ./src/components/pivot.vue
     @ ./src/router.js
     @ ./src/entry.js

However, my config should be right.
My webpack.config.js is a default one.

..
...
const webConfig = {
  context: pathTo.join(__dirname, ''),
  entry: entry,
  output: {
    path: pathTo.join(__dirname, 'dist'),
    filename: '[name].web.js',
  },
  module: {
    // webpack 2.0 
    rules: [
      {
        test: /\.js$/,
        use: [{
          loader: 'babel-loader'
        }],
        exclude: /node_modules/
      },
      {
        test: /\.vue(\?[^?]+)?$/,
        use: [{
          loader: 'vue-loader'
        }]
      }
    ]
  },
  plugins: plugins
};
const weexConfig = {
  entry: weexEntry,
  output: {
    path: pathTo.join(__dirname, 'dist'),
    filename: '[name].js',
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        use: [{
          loader: 'babel-loader',
        }],
        exclude: /node_modules(?!\/.*(weex).*)/
      },
      {
        test: /\.vue(\?[^?]+)?$/,
        use: [{
          loader: 'weex-loader'
        }]
      },
      {
        test: /\.we(\?[^?]+)?$/,
        use: [{
          loader: 'weex-loader'
        }]
      }
    ]
  },
  plugins: plugins,
};

var exports = [webConfig, weexConfig];

if (fileType === '.we') {
  exports = weexConfig;
}
module.exports = exports;

weex-loader不支持组件异步加载的写法吗?

当我尝试使用如下代码进行编译的时候

components: {
    'Title': () => import(/* webpackChunkName: "index" */ "./title.vue"),
}

报错:
weex-vue-loader Module build failed: SyntaxError: Unexpected token,

但是

components: {
    'Title': resolve => {require(['./title.vue'], resolve)},
}

这样写是没有问题的
另外
可否提出一个允许将多个组件chunkFileName后进行按需加载/异步加载的思路呢,因为单个bundle.js有点大

`0.3.2` 版本 dependencies 变动问题

0.3.2 版本开始把 babel-plugin-transform-runtime 从 devDependencies 挪到 dependencies,但是如果在项目下 package.json 里已经有了 babel-plugin-transform-runtime 的 devDependencies 的依赖,就会导致 npm install 之后,weex-loader 下的 node_modules 目录下其实并不存在 babel-plugin-transform-runtime 而是位于项目目录的 node_modules 目录下,
导致 https://github.com/weexteam/weex-loader/blob/master/src/loader.js#L136 报错。

解决办法:当加载 babel-plugin-transform-runtime 失败时需要同时检查 path.join(process.cwd(), 'node_modules') 下是否存在 babel-plugin-transform-runtime

文档示例无法运行

地址:http://alibaba.github.io/weex/doc/syntax/comm.html

<we-element name="foo">
  <template>
    <div>
      <image src="{{imageUrl}}" onclick="test"></image>
      <text>{{title}}</text>
    </div>
  </template>
  <script>
    module.exports = {
      data: {
        title: '',
        imageUrl: ''
      },
      methods: {
        test: function () {
          this.$dispatch('notify', {a: 1})
        }
      }
    }
  </script>
</we-element>

<template>
  <foo title="..." image-url="..."></foo>
</template>

<script>
  module.exports = {
    created: function () {
      this.$on('notify', function(e) {
        //  when <foo> image tag  be clicked ,the function will be executing.
        // e.detail is  `{a: 1}`
      })
    }
  }
</script>

使用es6的import和export出错

使用es6的import和export编写代码,编译后的文件目录如下图:
1
2
weexpack run android时显示render error:null。
查看weex-loader里面是有引入babel-preset-es2015的,照理应该支持es6 module,这种情况要如何解决呢?

运行时提示parse5模块不存在

gulp

module.js:339
throw err;
^

Error: Cannot find module 'parse5'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (/Users/qiaofu/Sites/mtb/weex-pro/node_modules/weex-loader/lib/parser.js:12:14)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)

webpack.config配置问题

  1. 在0.6.*版本之前,以下配置还是可用的:
var weexConfig = getBaseConfig();
weexConfig.output.filename = '[name].weex.js';
weexConfig.module.rules[2].loader = 'weex-loader';
weexConfig.module.rules[2].options = {
    lang: {
        less: ['less-loader']
    }
};
  1. 在最新版本中报Cannot read property 'map' of undefined,没文档、没参考,只能自己一点一点用console.log去判断,最后发现weex-loader的options中的lang已经弃用改用loaders了。就将代码修改为:
var weexConfig = getBaseConfig();
weexConfig.output.filename = '[name].weex.js';
weexConfig.module.rules[2].loader = 'weex-loader';
weexConfig.module.rules[2].options = {
    loaders: {
        less: ['less-loader']
    }
};
  1. 但还没完,实际使用过程中才发现,对于在.vue文件中配置的<style lang='less' scoped>,不能用mixins,最后又是一通console.log,靠猜和试才得出以下暂时可用的配置:
const less = require('postcss-less');
var weexConfig = getBaseConfig();
weexConfig.output.filename = '[name].weex.js';
weexConfig.module.rules[2].loader = 'weex-loader';
weexConfig.module.rules[2].options = {
    loaders: {
        less: ['less-loader']
    },
    postcss: {
        options: { syntax: less }
    }
};

对于webpack的config,还请官方不要频繁改动api导致配置变化,若实在需要改动,也请给出明确的文档作参考。

不支持 js 文件内 require 内置模块

目前仅支持在 .we 文件内 require('@weex-module/modal') 这样的内置模块的加载,如果在 .we 文件内 require 的 js 模块内部,有 require('@weex-module/modal') 这样内置模块的加载,就会报错:

wx-car ➤ weex debug src/pages/search/index.we --qr                                                                                                                       git:master*
building...
 [webpack errors]
 ./src/widgets/utils/common.js
Module not found: Error: Cannot resolve module '@weex-module/modal' in /Users/hongshu/dev/gitlab/wx-car/src/widgets/utils
resolve module @weex-module/modal in /Users/hongshu/dev/gitlab/wx-car/src/widgets/utils
  looking for modules in /Users/hongshu/dev/gitlab/wx-car/node_modules
    /Users/hongshu/dev/gitlab/wx-car/node_modules/@weex-module doesn't exist (module as directory)
[/Users/hongshu/dev/gitlab/wx-car/node_modules/@weex-module]
 @ ./src/widgets/utils/common.js 34:16-45  
@(    at /usr/local/lib/node_modules/weex-toolkit/node_modules/weex-devtool/lib/components/Builder.js:43:24

即使在 /usr/local/lib/node_modules/weex-toolkit/node_modules/weex-devtool/lib/components/Builder.js 内把 webpack config 加上 externals: [/@weex\-module/] 这样的配置规避掉报错,在手淘内仍然无法正常工作。

根结点下同时使用2个相同组件编译会变慢

详细可见 apache/incubator-weex-ui#175


1.Your development environment(weex、weex-toolkit、system and more).
  • weex-ui 0.5.1
  • weex 0.18.0
  • weex-toolkit
v1.2.7
weexpack : v1.1.5
weex-debugger : v1.0.3
weex-builder : v0.3.15
weex-previewer : v1.4.4

环境:mac os 10.13.2
问题描述:
import {WxcButton, WxcDialog} from 'weex-ui'
components: {'base_list': BaseList, WxcButton, WxcDialog},

UI:
<template>
    <div>
        <base_list :isShowResult="isShowResult"
                   :refreshing="refreshing"
                   :isShowLoading="isShowLoading"
                   :refreshText="refreshText"
                   @refresh="getOrderList"
                   @loadMore="loadMore">
            <cell slot="item" v-for="item in list" :key="item.orderId">
                <div class="order_item" v-on:click="orderItemClick(item.orderId)">
                    <div class="order_div_header">
                        <div class="order_div_shop_name">
                            <text class="order_text_shop_name" v-on:click="orderShopClick(item.shopName,item.shopId)">{{item.shopName}}</text>
                            <image class="order_img_shop_name"
                                   src="http://ldapp.oss-cn-shanghai.aliyuncs.com/image/right_arrow_ccc.png"></image>
                        </div>
                        <text class="order_text_status_name">{{item.statusName}}</text>
                    </div>
                    <div class="order_line"/>
                    <div class="order_div_content">
                        <div class="order_div_content_products">
                            <div v-for="(product,index) in item.orderItems" :key="product.id">
                                <image class="order_img_product" :src="product.imageUrl" v-if="index<3"/>
                            </div>
                        </div>
                        <image resize="contain" class="order_img_product_arrow" v-if="item.orderItems.length>3"
                               src="http://ldapp.oss-cn-shanghai.aliyuncs.com/image/product_more.png"/>
                        <div class="order_div_product_detail">
                            <text class="order_text_product_amount">¥{{item.totalAmount}}</text>
                            <text class="order_text_product_num">共{{item.goodsCount}}件</text>
                            <text class="order_text_product_arrive" v-if="item.deliveryTypeName">{{item.deliveryTypeName}}</text>
                        </div>
                    </div>
                    <div class="order_line"/>
                    <div class="order_div_footer">
                        <text class="order_text_time">{{formatOrderTime(item.orderTime)}}</text>
                        <div class="order_div_button">
                            <div v-for="button in item.buttonAction" :key="button.name">
                                <wxc-button :text="button.name"
                                            type="normal"
                                            :text-style="orderBtnTextStyle"
                                            :btn-style="orderBtnStyle"
                                            @wxcButtonClicked="orderBtnClick(item.orderId,button)"/>
                            </div>
                        </div>
                    </div>
                </div>
            </cell>

        </base_list>
        <wxc-dialog title="提示"
                    content="你确定要取消订单吗?"
                    main-btn-color="#42BD56"
                    :show="orderCancelDialogShow"
                    @wxcDialogCancelBtnClicked="wxcDialogOrderCancelBtnClicked"
                    @wxcDialogConfirmBtnClicked="wxcDialogOrderConfirmBtnClicked">
        </wxc-dialog>
        <wxc-dialog title="提示"
        content="你确定已经收到货了吗?"
        main-btn-color="#42BD56"
        :show="orderLogisticsDialogShow"
        @wxcDialogCancelBtnClicked="wxcDialogLogisticsCancelBtnClicked"
        @wxcDialogConfirmBtnClicked="wxcDialogLogisticsConfirmBtnClicked">
        </wxc-dialog>
    </div>
</template>

发现一个问题 ,同时使用两个WxcDialog后,会编译速度变慢,电脑风扇疯狂运转,并且一直卡在13%,如下图:

image

image
目前发现如果只使用一个WxcDialog节点,编译速度就正常了。暂时没发现其他weex-ui组件会这样。
望解答,或者有更好的方法,请指导!

Can not use pug

"weex-loader": "^0.6.14"
<template lang="pug">
</template>

error:

ERROR in ./node_modules/weex-loader/node_modules/weex-vue-loader/lib/template-compiler.js?id=data-v-2964abc9!./node_modules/weex-loader/node_modules/weex-vue-loader/lib/selector.js?type=template&index=0!./src/index.vue
    (Emitted value instead of an instance of Error) template syntax error Component template requires a root element, rather than just text.
     @ ./src/index.vue?entry=true 12:23-205

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.