vuejs / 011.vuejs.org Goto Github PK
View Code? Open in Web Editor NEWRepo for hosting 0.11 docs. For issues please use the 0.11 branch of the vuejs.org repo.
Repo for hosting 0.11 docs. For issues please use the 0.11 branch of the vuejs.org repo.
var myComp = Vue.extend({
template: '
Vue.component('my-comp', myComp);`
how to set component style? write *.css file and import in pages file?
@dan-gamble commented on Fri Aug 05 2016
I noticed this was attempted: vuejs-templates/webpack#154 and closed (For good reason)
But i wondered if anyone has a setup for this currently?
@xmoki commented on Mon Sep 05 2016
I think is possible to do it with htmlhint, but currently only supports jshint and csslint, maybe if someone can make a htmlhint rule for stylelint.
@JounQin commented on Mon Sep 05 2016
Actually we could use <style src="/path/of/style/file"/>
then just lint the style file as usual.
@yisibl commented on Wed Nov 09 2016
Touch .stylelintrc
{
"processors": ["stylelint-processor-html"],
"extends": "stylelint-config-standard"
}
Install
npm i stylelint -D
npm i stylelint-processor-html -D
npm i stylelint-config-standard -D
Add lint:css
to package.json
"scripts": {
"lint:css": "stylelint '**/*.vue' --syntax scss"
},
npm run lint:css
๐ป
@dan-gamble commented on Mon Nov 14 2016
@yisibl that works for me, swear i tried this before!
@scottsandersdev commented on Tue Dec 06 2016
I'm wondering if there's a way to get stylelint to report this to sublimelinter, although it works great from the command line, it doesn't work actively while typing in sublime. Have you or anyone else had any luck with that? Also, @yisibl thanks for posting this, helped me get started.
@bkzl commented on Sun Feb 12 2017
For the record, this is working configuration for webpack:
npm i --save-dev stylelint stylelint-processor-html stylelint-config-standard stylelint-webpack-plugin
.stylelintrc
{
"processors": ["stylelint-processor-html"],
"extends": "stylelint-config-standard"
}
build/webpack.dev.conf.js
for Vue webpack template)//...
var StylelintPlugin = require('stylelint-webpack-plugin')
{
//...
plugins: [
//...
new StylelintPlugin({
files: ['**/*.vue']
})
]
}
I published an article which includes both solutions and explains two additional things (configuration rules and errors when starting the dev server).
@wenkanglin commented on Tue Feb 14 2017
@bkzl i follow your config, use the stylelint-webpack-plugin
, it can work, but the line number of error reporter is incorrect for .vue
file.
@bkzl commented on Wed Feb 15 2017
@wenkanglin I immediately fix these errors while I code so I didn't even notice that. There is a corresponding issue: ccbikai/stylelint-processor-html/issues/1
@repsac-by commented on Fri Feb 24 2017
try @mapbox/stylelint-processor-arbitrary-tags
instead stylelint-processor-html
@jing2si commented on Thu May 25 2017
"scripts": {
"lint:css": "stylelint '**/*.vue' --syntax scss"
},
Can not add single quotation marks in windows. Otherwise it will report the following error.
Error: '**/*.vue' does not match any files
at globby.then.filePaths
The following setting worked well in windows 10
"scripts": {
"lint:css": "stylelint **/*.vue"
},
@gucong3000 commented on Fri Jul 28 2017
stylelint-webpack-plugin
or stylelint-processor-html
not support automatically fixes.
Related:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.