diff --git a/.eslintrc.js b/.eslintrc.js
index b6b5d34c..c101e75a 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -23,6 +23,7 @@ module.exports = {
'generator-star-spacing': 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
- 'space-before-function-paren': 0
+ 'space-before-function-paren': 0,
+ 'no-multiple-empty-lines': [2, { max: 2, maxEOF: 1 }]
}
}
diff --git a/src/App.vue b/src/App.vue
index fe45e6bf..c8f0615d 100755
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,27 +1,28 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
\ No newline at end of file
+
+
diff --git a/src/components/feed/commentInputTnstance.js b/src/components/feed/commentInputTnstance.js
new file mode 100644
index 00000000..d670c374
--- /dev/null
+++ b/src/components/feed/commentInputTnstance.js
@@ -0,0 +1,106 @@
+import Vue from 'vue'
+import CommentInput from './components/commentInput'
+
+const prefixCls = 'v-comment-input'
+
+CommentInput.newInstance = properties => {
+ const _props = properties || {}
+
+ const Instance = new Vue({
+ data: Object.assign({}, {
+ visible: true,
+ loading: false,
+ placeholder: '随便说说~'
+ }, _props),
+
+ render(h) {
+ let maskVNodes = []
+ maskVNodes.push(h('div', {
+ attrs: {
+ class: `${prefixCls}-mask`
+ },
+ on: {
+ 'click': this.maskClick
+ }
+ }))
+
+ let bodyVNodes = []
+
+ bodyVNodes.push(h('div', {
+ attrs: {
+ class: `${prefixCls}-wrap`
+ }
+ }, [h(CommentInput, {
+ class: `${prefixCls}`,
+ props: {
+ loading: this.loading,
+ focus: this.visible,
+ placeholder: this.placeholder
+ },
+ on: {
+ 'on-ok': this.ok
+ }
+ })]))
+
+ return h('div', {
+ directives: [{
+ name: 'show',
+ value: this.visible
+ }]
+ }, [maskVNodes, bodyVNodes])
+ },
+ computed: {},
+ methods: {
+ maskClick() {
+ this.visible = !this.visible
+ },
+ cancel() {
+ this.onCancel()
+ this.remove()
+ },
+ ok(txt) {
+ this.loading = true
+ this.onOk(txt, () => {
+ this.loading = false
+ this.cancel()
+ })
+ },
+ remove() {
+ this.$nextTick(() => {
+ this.destroy()
+ })
+ },
+ destroy() {
+ this.$destroy()
+ document.body.removeChild(this.$el)
+ this.onRemove()
+ },
+ onOk() {},
+ onCancel() {},
+ onRemove() {}
+ }
+ })
+
+ const Parent = Instance.$mount()
+ document.body.appendChild(Parent.$el)
+ const Input = Instance.$children[0]
+
+ return {
+ show(props) {
+ if ('onOk' in props) {
+ Parent.onOk = props.onOk
+ }
+ if ('placeholder' in props) {
+ Parent.placeholder = props.placeholder
+ }
+ Parent.onRemove = props.onRemove
+ Parent.visible = true
+ },
+ remove() {
+ Parent.remove()
+ },
+ components: Input
+ }
+}
+
+export default CommentInput
diff --git a/src/components/feed/components/commentInput.vue b/src/components/feed/components/commentInput.vue
index 696cd02d..ac5df346 100644
--- a/src/components/feed/components/commentInput.vue
+++ b/src/components/feed/components/commentInput.vue
@@ -1,13 +1,18 @@
-
{{ len }}/{{maxlength}}
- - -{{ len }}/{{maxlength}}
+ +{{ user.name }}
-粉丝数 - {{ followers_count }} -
-关注 - {{ followings_count }} -
-认证: - {{ verified.description }} -
-地址: - {{ location }} -
-简介: - {{ bio }} -
-{{ user.name }}
+粉丝数 + {{ followers_count }} +
+关注 + {{ followings_count }} +
+认证: + {{ verified.description }} +
+地址: + {{ location }} +
+简介: + {{ bio }} +
+注: 用户需经圈管理员同意方可加入封闭圈子
+注: 用户需经圈管理员同意方可加入封闭圈子
+点击创建即代表同意《ThinkSNS+圈子创建协议》
- -点击创建即代表同意《ThinkSNS+圈子创建协议》
+ +