You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
457 B
16 lines
457 B
import { computed, ref } from "vue";
|
|
import { getId } from "../handlers.js";
|
|
|
|
const html = (v) => { return v[0] };
|
|
|
|
export default {
|
|
props: ['text', 'withshortkey', 'autofocus'],
|
|
setup(props) {
|
|
const el = ref(null);
|
|
const suffix = computed(() => props.withshortkey ? ` (${getId(el.value)})`: "");
|
|
return { suffix, el }
|
|
},
|
|
template: html`
|
|
<div class="plain element" ref="el" v-autofocus="autofocus">{{ text }}{{ suffix }}</div>
|
|
`
|
|
}
|
|
|