import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import '@unocss/reset/sanitize/sanitize.css'
import '@unocss/reset/sanitize/assets.css'
import 'virtual:uno.css'
import { ImagePreview } from 'vant';

import router from "./router/index.js";
const app = createApp(App);
app.use(router);
app.use(ImagePreview);

app.directive('no-space', {
    mounted(el) {
        el.addEventListener('input', (e) => {
            const originalValue = e.target.value;
            const newValue = originalValue.replace(/\s/g, '');
            if (originalValue !== newValue) {
                e.target.value = newValue;
                e.target.dispatchEvent(new Event('input'));
            }
        });
    }
})
app.mount('#app');
