Stackedit/src/components/modals/LinkModal.vue
benweet abd0890512 Added favicons.
Added sponsorship options.
Added pdf and pandoc export.
Added emoji and mermaid extensions.
Added find/replace support.
Added HTML template with TOC.
Updated welcome file.
2017-11-04 16:59:48 +00:00

41 lines
1001 B
Vue

<template>
<modal-inner aria-label="Insert link">
<div class="modal__content">
<p>Please provide a <b>URL</b> for your link.</p>
<form-entry label="URL" error="url">
<input slot="field" class="textfield" type="text" v-model.trim="url" @keyup.enter="resolve()">
</form-entry>
</div>
<div class="modal__button-bar">
<button class="button" @click="reject()">Cancel</button>
<button class="button" @click="resolve()">Ok</button>
</div>
</modal-inner>
</template>
<script>
import modalTemplate from './common/modalTemplate';
export default modalTemplate({
data: () => ({
url: '',
}),
methods: {
resolve() {
if (!this.url) {
this.setError('url');
} else {
const callback = this.config.callback;
this.config.resolve();
callback(this.url);
}
},
reject() {
const callback = this.config.callback;
this.config.reject();
callback(null);
},
},
});
</script>