Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm后,如何import或者require 导入呢? #30

Open
zhaopeng521 opened this issue Nov 12, 2021 · 10 comments
Open

npm后,如何import或者require 导入呢? #30

zhaopeng521 opened this issue Nov 12, 2021 · 10 comments

Comments

@zhaopeng521
Copy link

No description provided.

@DominguitoLamo
Copy link
Contributor

就把打包后的文件用script引入就可以了, script記得加defer

@zhaopeng521
Copy link
Author

这个我知道的 ,在模块化开发时,会按需引进的;全局引进有时不会立即生效,

@zhaopeng521
Copy link
Author

在vue项目中,修改代码后代码会不生效,不去执行

@DominguitoLamo
Copy link
Contributor

热部署的情况下是无效的, 因为它在页面加载时初始化

@zhaopeng521
Copy link
Author

所以就会希望可以直接import导入相应组件中使用

@zhaopeng521
Copy link
Author

还有一个问题,如果我想让元素变颜色的同时,也进行偏移运动,同时再进行透明化,应如何配置呢

@DominguitoLamo
Copy link
Contributor

由于现在每个元素只能绑定一个css变量, 暂时无法实现, 我最近也在思考可以绑定多个变量, 但需要从整个项目重构, 暂时需要一些时间

@stevenlei
Copy link
Contributor

@zhaopeng521 目前可以通过嵌套多个元素来实现。可以参考:https://codepen.io/stevenlei/pen/VwzGbwK

@stevenlei
Copy link
Contributor

另外 import 应该是引入 src/trigger.js 的,但是现在会自动绑定 DOM,我们需要的可能是一个类似于 Trigger.refreshDOM() 的功能。

@zhaopeng521
Copy link
Author

@stevenlei vue中修改代码后总是失效很久

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants