touch-vue-pc 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "touch-vue-pc",
3
- "version": "1.0.2",
4
- "main":"./packages/index.js",
3
+ "version": "1.0.3",
4
+ "main": "./packages/index.js",
5
5
  "bin": {
6
6
  "touch-vue-pc": "./packages/index.js"
7
7
  },
@@ -16,6 +16,7 @@
16
16
  "dist/*",
17
17
  "src/*",
18
18
  "public/*",
19
+ "packages/*",
19
20
  "*.json",
20
21
  "*.js"
21
22
  ],
package/packages/index.js CHANGED
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env node
2
1
  import TcTable from './table/index.js'
3
2
  const components = [
4
3
  TcTable
@@ -0,0 +1,5 @@
1
+ import TcTable from './src/table.vue'
2
+ TcTable.install = function (Vue) {
3
+ Vue.component(TcTable.name, TcTable)
4
+ }
5
+ export default TcTable
@@ -0,0 +1,73 @@
1
+ <template>
2
+ <div v-show="showInput">
3
+ <el-input v-model="currentValue" v-bind="$props" @keydown.enter.native="handleInputEnter" :placeholder="placeholder" :dataType="dataType" ref="input" :inputPattern='inputPattern'>
4
+
5
+ </template>
6
+ </el-input>
7
+ </div>
8
+ </template>
9
+ <script>
10
+ import { Input, Button, Select, Option } from 'element-ui'
11
+
12
+ const EMAIL_ERROR = '邮箱验证失败';
13
+
14
+ export default {
15
+ name: "TcTable",
16
+ data() {
17
+ return {
18
+ showInput: true,
19
+ inputType: '',
20
+ };
21
+ },
22
+ props: {
23
+ ...Input.props, //继承elementUI原有的props
24
+ ...Button.props,
25
+ ...Select.props,
26
+ ...Option.props,
27
+ value: {
28
+ type: [Number, String],
29
+ default: ''
30
+ },
31
+ placeholder: {
32
+ type: String,
33
+ default: '请输入内容'
34
+ },
35
+ },
36
+ computed: {
37
+ currentValue: {
38
+ get: function() {
39
+ return this.value;
40
+ },
41
+ set: function(newValue) {
42
+ this.$emit("input", newValue); // 通过 input 事件更新 model
43
+ }
44
+ }
45
+ },
46
+ methods: {
47
+ evtChange(newValue, lr) {
48
+ this.$emit('change', newValue, lr); // 事件传值
49
+ },
50
+ handleInputEnter() {
51
+ },
52
+ },
53
+ mounted() {
54
+ this.$nextTick(_ => {
55
+ this.inputType = this.$refs.input.type;
56
+ })
57
+ console.log('mounted');
58
+ },
59
+ updata() {
60
+
61
+ },
62
+ watch: {
63
+ currentValue: {
64
+ immediate: true,
65
+ handler(val) {
66
+ }
67
+ }
68
+ }
69
+ }
70
+
71
+ </script>
72
+ <style stylus="css">
73
+ </style>