Skip to content
This repository was archived by the owner on Dec 26, 2018. It is now read-only.

Commit f09dfd3

Browse files
committed
bump 3.0
1 parent 79d039c commit f09dfd3

File tree

2 files changed

+60
-5
lines changed

2 files changed

+60
-5
lines changed

README.md

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# vueify [![npm version](https://badge.fury.io/js/vueify.svg)](http://badge.fury.io/js/vueify) [![Build Status](https://circleci.com/gh/vuejs/vueify.svg?style=shield)](https://circleci.com/gh/vuejs/vueify)
22

3-
> [Browserify](http://browserify.org/) transform for [Vue.js](http://vuejs.org/) components
3+
> [Browserify](http://browserify.org/) transform for [Vue.js](http://vuejs.org/) components, with scoped CSS and component hot-reloading.
44
55
This transform allows you to write your components in this format:
66

@@ -128,7 +128,58 @@ module.exports = function (vueify) {
128128
}
129129
```
130130
131-
### Compiler API
131+
### Scoped CSS
132+
133+
> Experimental
134+
135+
When a `<style>` tag has the `scoped` attribute, its CSS will apply to elements of the current component only. This is similar to the style encapsulation found in Shadow DOM, but doesn't require any polyfills. It is achieved by transforming the following:
136+
137+
``` html
138+
<style scoped>
139+
.example {
140+
color: red;
141+
}
142+
</style>
143+
<template>
144+
<div class="example">hi</div>
145+
</template>
146+
```
147+
148+
Into the following:
149+
150+
``` html
151+
<style>
152+
.example[_v-1] {
153+
color: red;
154+
}
155+
</style>
156+
<template>
157+
<div class="example" _v-1>hi</div>
158+
</template>
159+
```
160+
161+
#### Notes
162+
163+
1. You can include both scoped and non-scoped styles in the same component.
164+
165+
2. A child component's root node will be affected by both the parent's scoped CSS and the child's scoped CSS.
166+
167+
3. Partials are not affected by scoped styles.
168+
169+
### Hot Reload
170+
171+
> Experimental
172+
173+
To enable hot component reloading, you need to install the [browserify-hmr](https://github.com/AgentME/browserify-hmr) plugin:
174+
175+
``` bash
176+
npm install browserify-hmr --save-dev
177+
watchify -p browserify-hmr index.js -o bundle.js
178+
```
179+
180+
A full setup example with hot reloading is available at [vuejs/vueify-example](https://github.com/vuejs/vueify-example).
181+
182+
## Compiler API
132183

133184
The compiler API (originally `vue-component-compiler`) is also exposed:
134185

@@ -147,12 +198,16 @@ And here's a [SublimeText package](https://github.com/vuejs/vue-syntax-highlight
147198

148199
## Example
149200

150-
For an example setup, see [vuejs/vueify-example](https://github.com/vuejs/vueify-example).
201+
For an example setup using most of the features mentioned above, see [vuejs/vueify-example](https://github.com/vuejs/vueify-example).
151202

152203
If you use Webpack, there's also [vue-loader](https://github.com/vuejs/vue-loader) that does the same thing.
153204

154205
## Changelog
155206

207+
### 3.0.0
208+
209+
- Added support for [scoped CSS](#scoped-css) and [component hot reloading](#hot-reload).
210+
156211
### 2.0.1
157212

158213
- Built-in lang for ES2015 has been renamed from `es6` to `es`.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vueify",
3-
"version": "2.0.1",
3+
"version": "3.0.0",
44
"description": "Vue component transform for Browserify",
55
"main": "index.js",
66
"repository": {
@@ -29,7 +29,7 @@
2929
"postcss": "^5.0.10",
3030
"postcss-selector-parser": "^1.3.0",
3131
"through": "^2.3.6",
32-
"vue-hot-reload-api": "^1.0.0"
32+
"vue-hot-reload-api": "^1.1.0"
3333
},
3434
"devDependencies": {
3535
"babel": "^5.8.23",

0 commit comments

Comments
 (0)