naive-ui/demo/documentation/components/popconfirm/enUS/customAction.md
2019-12-23 16:31:26 +08:00

811 B
Raw Blame History

Custom Action

<n-popconfirm :controller="controller">
  <template v-slot:activator>
    <n-button>Quote</n-button>
  </template>
  For example, if I were to write about elephants, Id have had no idea what words to use.
  <template v-slot:action>
    <n-button
      size="tiny"
      @click="handleClick"
    >
      Maybe
    </n-button>
  </template>
</n-popconfirm>
<n-popconfirm positive-text="Oops!">
  <template v-slot:activator>
    <n-button>Quote</n-button>
  </template>
  For example, if I were to write about elephants, Id have had no idea what words to use.
</n-popconfirm>
export default {
  data () {
    return {
      controller: {}
    }
  },
  methods: {
    handleClick () {
      this.controller.hide()
    }
  }
}
.n-button {
  margin-right: 8px;
}