@ -1,18 +1,18 @@
|
||||
<template>
|
||||
<div class="mk-poll-editor">
|
||||
<p class="caution" v-if="choices.length < 2">
|
||||
<fa icon="exclamation-triangle"/>%i18n:@no-only-one-choice%
|
||||
<fa icon="exclamation-triangle"/>{{ $t('no-only-one-choice') }}
|
||||
</p>
|
||||
<ul ref="choices">
|
||||
<li v-for="(choice, i) in choices">
|
||||
<input :value="choice" @input="onInput(i, $event)" :placeholder="'%i18n:@choice-n%'.replace('{}', i + 1)">
|
||||
<button @click="remove(i)" title="%i18n:@remove%">
|
||||
<input :value="choice" @input="onInput(i, $event)" :placeholder="this.$t('choice-n').replace('{}', i + 1)">
|
||||
<button @click="remove(i)" :title="$t('remove')">
|
||||
<fa icon="times"/>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
<button class="add" v-if="choices.length < 10" @click="add">%i18n:@add%</button>
|
||||
<button class="destroy" @click="destroy" title="%i18n:@destroy%">
|
||||
<button class="add" v-if="choices.length < 10" @click="add">{{ $t('add') }}</button>
|
||||
<button class="destroy" @click="destroy" :title="$t('destroy')">
|
||||
<fa icon="times"/>
|
||||
</button>
|
||||
</div>
|
||||
@ -20,8 +20,10 @@
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import i18n from '../../../i18n';
|
||||
import { erase } from '../../../../../prelude/array';
|
||||
export default Vue.extend({
|
||||
i18n: i18n('common/views/components/poll-editor.vue'),
|
||||
data() {
|
||||
return {
|
||||
choices: ['', '']
|
||||
|
Reference in New Issue
Block a user