<style lang="sass"></style>
import './sub.sass';
module.exports = function(){
var oBox =document.createElement('p')
oBox.className = 'p2'
oBox.innerHTML = 'form greet2'
return oBox
}
You can import, but you cannot write in js files
<style lang="sass">
</style>
我想大声告诉你2017-06-26 10:53:05
The
<style>
tag is an HTML tag, and of course it cannot be written in a JS file. Import is the new syntax of Javascript ES6, so it can be used directly.
PHP中文网2017-06-26 10:53:05
You can write it, for example in the vue component template, but if you write it this way, you need a corresponding loader to compile, load and recognize your special js file.