Suggestion box
Suggestion box for Project Trans's website.
Usage
pnpm add @project-trans/suggestion-box
pnpm add @iconify-json/octicon -D
In your Vue component:
<template>
<SuggestionBox
target-url="https://example.com"
contact-content-placeholder="联系方式占位符"
text-content-placeholder="文本内容占位符"
attach-image-button-text="附加图片按钮文案"
send-button-text="发送按钮文案"
sending-button-text="发送中按钮文案"
sent-success-button-text="发送成功按钮文案"
sent-failed-button-text="发送失败按钮文案"
/>
</template>
<script>
import SuggestionBox from '@project-trans/suggestion-box';
import '@project-trans/suggestion-box/dist/style.css';
</script>
In uno.config.ts
:
import { defineConfig, presetUno, presetIcons } from 'unocss';
import presetSBox from '@project-trans/suggestion-box/dist/preset';
export default defineConfig({
content: {
pipeline: {
include: [
/\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/,
/.*pjts-suggestion-box.*\.js/,
],
},
},
presets: [
presetUno(),
presetIcons(),
presetSBox(),
],
});
Development
corepack enable
Install dependencies
pnpm install
Start UI development server
pnpm dev
Start Cloudflare Pages Functions development server
pnpm -F server dev