Code Monkey home page Code Monkey logo

Comments (5)

imyelo avatar imyelo commented on May 18, 2024 1

I tried to run your code and found that wux-weapp's source code mistakenly mixed ESM and CJS. In the above use case, we need to modify these two files as follows:

1.node_modules/wux-weapp/dist/helpers/computedBehavior.js

// ...
- module.exports = Behavior({
+ export default Behavior({
//

2.node_modules/wux-weapp/dist/helpers/relationsBehavior.js

// ...
- module.exports = Behavior({
+ export default Behavior({
//

But I suggest you make a PR to wux-weapp, a change that makes their code more robust. 😉

from tina.

alinjiajun avatar alinjiajun commented on May 18, 2024

你好 我是下载了wux-weapp取了dist目录下的部分组件,但是引入后报这些错误,该怎么处理呢
image

from tina.

imyelo avatar imyelo commented on May 18, 2024

你好 我是下载了wux-weapp取了dist目录下的部分组件,但是引入后报这些错误,该怎么处理呢
image

看截图的错误提示是 animation-group 依赖 helpers/baseComponent,而这个文件漏了。试下把完整的 dist 目录拷进去呢?

from tina.

alinjiajun avatar alinjiajun commented on May 18, 2024

我测了最简单的wux-button组件,并且全部dist都引入。在原生项目里引入就没报错。现在是报了这个错,感觉是webpack处理js的问题?
image

from tina.

imyelo avatar imyelo commented on May 18, 2024

@alinjiajun 建议直接用 npm 引入;如果复制 dist 目录引入的话,要留意把 webpack 里的配置改为:

// ...
      {
        test: /\.mina$/,
-        exclude: /node_modules/,
+        exclude: [/node_modules/, require('path').resolve(__dirname, 'src/wuxui')],
        use: [
          {
            loader: '@tinajs/mina-loader',
            options: {
              loaders,
            },
          },
        ],
      },
// ...

from tina.

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.