Skip to content

Commit

Permalink
Plugin: Export function on Vue
Browse files Browse the repository at this point in the history
  • Loading branch information
airyland committed Feb 24, 2017
1 parent 3412c58 commit 5e20994
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 2 deletions.
15 changes: 15 additions & 0 deletions build/build-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,19 @@ glob(getPath('../src/tools/**/metas.yml'), {}, function (err, files) {
fs.writeFileSync(getPath('../src/tools/changes.json'), JSON.stringify(rs, null, 2))
})

glob(getPath('../src/plugins/**/metas.yml'), {}, function (err, files) {
let rs = []
files.forEach(function(file){
const name = file.split('plugins/')[1].replace('/metas.yml', '')
const json = yaml.safeLoad(fs.readFileSync(file, 'utf-8'))
rs.push({
name: name,
metas: json
})
})
fs.writeFileSync(getPath('../src/plugins/changes.json'), JSON.stringify(rs, null, 2))
})

function getComponentName(path) {
let list = path.split('/')
if (list[list.length - 1] === 'index.vue' || list[list.length - 1] === 'index.js') {
Expand Down Expand Up @@ -658,7 +671,9 @@ function parseChange (str) {

function buildChanges(infos) {
const toolInfos = require(getPath('../src/tools/changes.json'))
const pluginInfos = require(getPath('../src/plugins/changes.json'))
infos = infos.concat(toolInfos)
infos = infos.concat(pluginInfos)
let rs = {}
infos.forEach(one => {
let name = one.name
Expand Down
5 changes: 5 additions & 0 deletions src/components/cell/metas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ slots:
en: the child element of the cell, you can add an element with absolute position
zh-CN: cell的直接子元素,因此可以添加一个相对于cell绝对定位的元素
changes:
v2.1.1-rc.3:
en:
- '[feature] Add font-size variable #990 @wg5945'
zh-CN:
- '[feature] 支持字体变量 #990 @wg5945'
v2.1.0-rc.47:
zh-CN:
- '[enhance] 修复内容多时的箭头位置 #715 @greedying '
4 changes: 2 additions & 2 deletions src/components/swiper/metas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ props:
changes:
v2.1.1-rc.3:
en:
- '[fix] Fix nodes list forEach function is undefined'
- '[fix] Fix nodes list forEach function is undefined #991 @howyhuang'
zh-CN:
- '[fix] 修复 node 列表没有 forEach 方法'
- '[fix] 修复 node 列表没有 forEach 方法 #991 @howyhuang'
v2.1.1-rc.2:
en:
- '[fix] Fix es6 iterator compability, use forEach'
Expand Down
1 change: 1 addition & 0 deletions src/plugins/ajax/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import axios from 'axios'
export default {
install (Vue) {
Vue.prototype.$http = axios
Vue.http = axios
},
$http: axios
}
Expand Down
6 changes: 6 additions & 0 deletions src/plugins/ajax/metas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
changes:
v2.1.1-rc.3:
zh-CN:
- '[feature] 支持通过 Vue.http 调用'
en:
- '[feature] Export http on Vue'
1 change: 1 addition & 0 deletions src/plugins/wechat/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const wx = require('weixin-js-sdk')
const plugin = {
install (Vue) {
Vue.prototype.$wechat = wx
Vue.wechat = wx
},
$wechat: wx
}
Expand Down
6 changes: 6 additions & 0 deletions src/plugins/wechat/metas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
changes:
v2.1.1-rc.3:
zh-CN:
- '[feature] 支持通过 Vue.wechat 调用'
en:
- '[feature] Export wechat on Vue'

0 comments on commit 5e20994

Please sign in to comment.