Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 基于id定位的任意插槽 #15

Merged
merged 7 commits into from
Mar 19, 2019

Conversation

2nthony
Copy link
Member

@2nthony 2nthony commented Mar 11, 2019

New

  • 支持基于$id的具名插槽,插槽内容会出现在对应位置的上方

Usage

<div id="app">
  <FormRenderer ref="formRenderer" :content="content">
    <button slot="$id:id" @click="updateValue">更新表单年龄</button>

    <ElFormItem label="您贵庚" slot="$id:name">
      <ElInput v-model="age" />
    </ElFormItem>
  </FormRenderer>
</div>

<script>
new Vue({
  data: {
    content: [
      {
        label: 'label',
        $id: 'id',
        $type: 'input'
      },
      {
        label: 'name',
        $id: 'name',
        $type: 'input'
      }
    ],
    age: ''
  },
  methods: {
    updateValue() {
      this.$refs.formRenderer.updateValue({ id: 'age', value: this.age })
    }
  }
})
</script>

@2nthony 2nthony changed the title feat: slot wherever you want feat: 任意分支的插槽 Mar 14, 2019
@2nthony 2nthony changed the title feat: 任意分支的插槽 feat: 基于id定位的任意插槽 Mar 14, 2019
@levy9527 levy9527 merged commit af2c3dc into FEMessage:master Mar 19, 2019
@2nthony 2nthony deleted the feat-slotify branch May 25, 2019 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants