New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

use-tool

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-tool

```js src config router.js store.js views home.vue main.js vite.config.js ```

latest
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

##1.src下新建目录config

src
    config
        router.js
        store.js
    views
        home.vue
    main.js
vite.config.js

##main.js

import { createApp } from 'vue'
import App from './App.vue'
import store from "./config/store";
import router from "./config/router";
import useTool from "./useTool";

createApp(App).use(useTool,{store,router}).mount('#app')

router.js

import Home from '@/views/home'

export default [
    {
        path: '/',
        component: Home
    },
    // {
    //     path: '/about',
    //     component: ()=> import('@/views/about')
    // },
]

store.js

export default {
    state () {
        return {
            count: 0
        }
    },
    mutations: {
        increment (state) {
            state.count++
        },
    }
}

vite.config.js

import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import {resolve} from 'path'

export default defineConfig({
    plugins: [
        vue(),
    ],
    resolve: {
        extensions: ['.js', '.vue', '.json','.mjs'],
        alias: {
            '@': resolve(__dirname, 'src')
        }
    },
    css: {
        // 使用 scss
        // preprocessorOptions: {
        //     scss: {}
        // }
    },
    server: {
        proxy: {
            // '/api': {
            //     target: 'http://jsonplaceholder.typicode.com',
            //     changeOrigin: true,
            //     rewrite: (path) => path.replace(/^\/api/, '')
            // }
        }
    }
})

home.vue

    <template>
    
    </template>
    
    <script setup>
    console.log($this);
    </script>
    
    <style scoped lang="scss">
    
    </style>

FAQs

Package last updated on 25 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts