Skip to content

Commit 77918ed

Browse files
committed
fix: update Footer component type declaration and improve issue message formatting
1 parent 7e94ffa commit 77918ed

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

playground/src/App.vue

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { cssSuggestions } from './utils'
1515
import 'vivid-typing/dist/index.css'
1616
1717
const { t, locale } = useI18n()
18-
1918
const input = ref('')
2019
let pre: any
2120
= '<template>\n <button>button</button>\n</template>\n\n<style scoped>\n button {\n height: 32px;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 14px;\n cursor: pointer;\n user-select: none;\n padding: 8px 15px;\n border-radius: 4px;\n border: none;\n box-sizing: border-box;\n color: #fff;\n background-color: #409eff;\n margin: auto;\n }\n button:hover{\n background-color: #67c23a ;\n }\n</style>\n'
@@ -451,7 +450,7 @@ onUnmounted(() => {
451450
window.removeEventListener('resize', updateEditorDimensions)
452451
})
453452
454-
function onSelect(value: string) {
453+
function onSelect(value: any) {
455454
input.value = `${value}: `
456455
nextTick(() => {
457456
autoComplete.value.focus()
@@ -517,32 +516,34 @@ function onSelect(value: string) {
517516
<div flex items-center my3>
518517
<input v-model="isChecked" type="checkbox" w4 h4 mr1> isRem
519518
</div>
520-
<div v-if="transform" flex="~ gap-4" items-center>
521-
<div font-bold text="18px">
522-
{{ t('result') }}
523-
</div>
524-
<div flex gap-2 items-center>
525-
{{ transform }}
526-
<div
527-
:class="[
528-
isCopy
529-
? 'i-carbon:checkmark-outline text-green!'
530-
: ' i-carbon:copy',
531-
]"
532-
cursor-pointer
533-
hover="color-orange"
534-
@click="copyStyle"
535-
/>
519+
<div min-h-20 flex items-center justify-center>
520+
<div v-if="transform" flex="~ gap-4" items-center>
521+
<div font-bold text="18px">
522+
{{ t('result') }}
523+
</div>
524+
<div flex gap-2 items-center break-all>
525+
{{ transform }}
526+
<div
527+
:class="[
528+
isCopy
529+
? 'i-carbon:checkmark-outline text-green!'
530+
: ' i-carbon:copy',
531+
]"
532+
cursor-pointer
533+
hover="color-orange"
534+
@click="copyStyle"
535+
/>
536+
</div>
536537
</div>
537-
</div>
538-
<template v-else>
539-
<template v-if="input">
540-
<div h-20 v-html="t('issue')" />
541-
</template>
542538
<template v-else>
543-
<div h-20 box-border pt6 v-html="t('find')" />
539+
<template v-if="input">
540+
<div v-html="t('issue')" />
541+
</template>
542+
<template v-else>
543+
<div box-border pt6 v-html="t('find')" />
544+
</template>
544545
</template>
545-
</template>
546+
</div>
546547
</div>
547548
<div flex>
548549
<div w="50%">

playground/src/locales/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const messages = {
66
result: 'Result:',
77
match: 'The current value is wrong, or the matching error!',
88
demo: 'If you enter a legal value, you can add your example here.',
9-
issue: `<h2>The current value is wrong, or the matching error</h2>
9+
issue: `<div class="font-800 text-2xl">The current value is wrong, or the matching error</div>
1010
If you enter a legal value, you can add your example here.
1111
<a
1212
href="https://github.com/Simon-He95/transformToUnocss/issues"

playground/unocss.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default defineConfig({
3434
},
3535
}),
3636
],
37+
safelist: ['font-800', 'text-2xl'],
3738
// transformers: [
3839
// transformerDirectives(),
3940
// transformerVariantGroup(),

playground/vite.config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ export default defineConfig({
1717
},
1818
},
1919
plugins: [
20-
Vue({
21-
reactivityTransform: path.resolve(__dirname, 'src'),
22-
}),
20+
Vue(),
2321

2422
// https://github.com/hannoeru/vite-plugin-pages
2523
Pages(),

0 commit comments

Comments
 (0)