94-toast
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

94Toast

安装

npm i 94-toast

导入

// main.ts

import '94-toast/style.css'
import { ToastPlugin } from '94-toast';

const app = createApp(App);
app.use(ToastPlugin);
app.mount('#app');

使用

<script lang="ts">
export default {
  name: "App",
  methods: {
    toast() {
      this.$toast.show('Hello Vuejs')
    }
  }
}
</script>
<script setup lang="ts">
import { getCurrentInstance } from 'vue';
const global = getCurrentInstance()?.appContext.config.globalProperties;

const toast = () => {
  global?.$toast.show('Hello Vuejs')
}
</script>
<script lang="ts">
import { defineComponent, getCurrentInstance } from 'vue';
export default defineComponent({
  name: "App",
  setup() {

   const global = getCurrentInstance()?.appContext.config.globalProperties;

    const toast = () => {
      global?.$toast.show('Hello Vuejs')
    }

    return {
      toast,
    }
  }
})
</script>

Readme

Keywords

none

Package Sidebar

Install

npm i 94-toast

Weekly Downloads

5

Version

0.0.4

License

none

Unpacked Size

5.87 kB

Total Files

7

Last publish

Collaborators

  • zhangxin_n22