pandao / gulp-vue-module

Gulp plugin for Vue.js *.vue component file complie to AMD / CMD / CommonJS module.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

where should I implement require.loadCSS()?

lynnic26 opened this issue · comments

I can't understant why should I implement a method like require.loadCSS
Is it necessary or just optional when I am running an gulp compile with *.vue file?
and If we must implement this method ,where should I put it in my code?

@lynnic26

gulp-vue-module just is the *.vue file compiler, So you when using must implement require.loadCSS() method.
Implementation of the require.loadCSS() method for dynamic load module style.

Example:

// If use Require.js or Sea.js or Any Front-end Module loader
// Require.js or Sea.js code 
// ...
// require.loadCSS() implement here

Or you not use the <style> tag in *.vue file.

还是用中文交流吧,
您的意思是只有在外部代码中实现了require.loadCSS(),
才能在*.vue文件里使用<style>标签?否则的话就不能使用<style>标签?

@lynnic26 是的

这种在require上定义的方法是公用方法吗?
我在seajs的官方文档上为啥没有找到相关的说明?

@lynnic26 是,要自己实现这个方法