webview.vue 410 B

12345678910111213141516171819202122232425
  1. <template>
  2. <web-view :src="webViewSrc"></web-view>
  3. </template>
  4. <script>
  5. import {getToken} from '@/libs/auth.js';
  6. export default {
  7. data() {
  8. return {
  9. webViewSrc:""
  10. }
  11. },
  12. onLoad(options) {
  13. this.init(options)
  14. },
  15. methods: {
  16. init(options){
  17. this.webViewSrc=`${options.href}?token=${getToken()}`
  18. uni.setNavigationBarTitle({
  19. title:`${options.name}`
  20. })
  21. }
  22. }
  23. }
  24. </script>