0.0.7 • Published 10 months ago

uni-use-router v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

uni-use-router

npm version npm downloads bundle JSDocs License

UniApp 路由跳转补充,与 Vue Router 语法靠近

🚀 Install

pnpm add uni-use-router --save-dev

⚡️ Usage

<script setup lang="ts">
import { useRouter } from 'uni-use-router'

const router = useRouter({
  webview: '/pages/webview'
})
</script>

<template>
  <view class="box">
    <button @click="router.push('/pages/test/test?a=1&b=2')">
      Go Test
    </button>
    <button
      @click="router.push({
        url: '/pages/test/test',
        query: {
          a: 1,
          b: '2',
          c: null,
        },
      })"
    >
      Go Test
    </button>
    <button @click="router.replace('/pages/test/test')">
      Go Replace
    </button>
    <button @click="router.push('https://www.baidu.com')">
      Go H5
    </button>
  </view>
</template>

<style scoped>
.box {
  display: flex;
  flex-direction: column;
  gap: 10rpx;
}
</style>

License

MIT License © 2024-PRESENT Ares Chang

0.0.7

10 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago

0.0.0

11 months ago