Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
hinesboy committed Apr 14, 2017
0 parents commit bab60fb
Show file tree
Hide file tree
Showing 49 changed files with 10,938 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/node_modules/*
/.idea/*
npm-debug.log
git-debug.log
6 changes: 6 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/node_modules/*
/.idea/*
/.git/*
LICENSE
npm-debug.log
git-debug.log
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 hinesboy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
116 changes: 116 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# mavonEditor

> 基于Vue的markdown编辑器

## Use Setup (开始)

### Install auto-textarea (安装)

```
$ npm install autoTextarea --save
```

### package.json

```
"auto-textarea": "^1.3.2"
```

### Use (如何引入)

```
// 方法一
// import with ES6
import Vue from 'vue'
import autoTextarea from 'autoTextarea'
// require with Webpack/Node.js
var Vue = require('vue')
var autoTextarea = require('autoTextarea')
// use
Vue.use(autoTextarea)
```

```
// 方法二
// or use with component(ES6)
import { autoTextarea } from 'autoTextarea'
export default {
components: {
autoTextarea
}
}
```

``` html
// html
<autoTextarea placeholder="" lineHeight="30px" border="false" fontSize="18px" :value="" :onchange="function"/>
```

### 监听value

``` html
<!-- 使用双向绑定修饰符 -->
<autoTextarea v-model="value"/>
```

``` html
<!-- 当value发生改变 , 出发onchange事件 参数为改变后的value -->
<autoTextarea :value="value" :onchange="function"/>
```

## API (props)

| name 名称 | type 类型 | default 默认值 | des 描述 |
| -------- | :---------: | :------------: | ------- |
| value | String | | 初始值 |
| lineHeight | String | 18px | 输入框的行高 |
| fontSize | String | 14px | 输入框文字大小 |
| placeholder | String | | 输入框默认文字 |
| border | Boolean | false | 是否带有边框 |
| onchange | Function | | 监听内容变化 , function(val , $event) |

## analyse (原理剖析)

``` html
// html
<div>
<pre><br>{{value}}</pre>
<textarea v-model="value" placeholder="输入文字"></textarea>
</div>
```

``` stylus
// css
div
position relative
pre
display block
visibility hidden
textarea
position absolute
width 100%
height 100%
top 0
left 0
```

## Dependencies (依赖)

[stylus](https://github.com/stylus/stylus)

[stylus-loader](https://github.com/shama/stylus-loader)

## reference (参考)

[textarea 自适应](https://segmentfault.com/q/1010000000095238)

## Licence (证书)

autoTextarea is open source and released under the MIT Licence.

Copyright (c) 2017 hinesboy

20 changes: 20 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Created by zhy on 2017/4/1.
*/
'use strict';

/**
* mavonEditor
* @author hinesboy
*/

const mavonEditor = require('./mavon-editor.vue');

const VueMavonEditor = {
mavonEditor: mavonEditor,
install: function(Vue) {
Vue.component('mavon-editor', mavonEditor);
},
};

module.exports = VueMavonEditor;
7 changes: 7 additions & 0 deletions lib/font-awesome-4.7.0/HELP-US-OUT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
I hope you love Font Awesome. If you've found it useful, please do me a favor and check out my latest project,
Fort Awesome (https://fortawesome.com). It makes it easy to put the perfect icons on your website. Choose from our awesome,
comprehensive icon sets or copy and paste your own.

Please. Check it out.

-Dave Gandy
Loading

0 comments on commit bab60fb

Please sign in to comment.