javascript - <style lang="sass"></style> reports errors in js
PHP中文网
PHP中文网 2017-06-26 10:51:05
0
2
845

<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>

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
我想大声告诉你

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.

洪涛

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!