Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

目前vue-router或者react-router似乎都是不支持的 #286

Closed
jnxey opened this issue May 7, 2021 · 12 comments · Fixed by #711
Closed

目前vue-router或者react-router似乎都是不支持的 #286

jnxey opened this issue May 7, 2021 · 12 comments · Fixed by #711
Assignees
Labels
enhancement New feature or request P3
Milestone

Comments

@jnxey
Copy link

jnxey commented May 7, 2021

使用场景

使用最新的samples-main/demos/hello-react 或samples-main/demos/hello-vue
vue-router与react-router都不能正常显示(白屏,使用Memory模式)

提案

能够正常显示

@jnxey jnxey added the enhancement New feature or request label May 7, 2021
@wssgcg1213
Copy link
Member

可以提供更多信息吗, 比如有没有报错, 以及使用的方式(代码片段)

@olin2011
Copy link

olin2011 commented May 8, 2021

和flutter版本有关吗,我的2.0,也是白屏。多页面也是一般vue的实现?

@andycall
Copy link
Member

andycall commented May 8, 2021

flutter 2.0 现在还不支持

@jnxey
Copy link
Author

jnxey commented May 9, 2021

可以提供更多信息吗, 比如有没有报错, 以及使用的方式(代码片段)

稍等下,我现在需要在新的电脑重新搭建环境

@jnxey
Copy link
Author

jnxey commented May 10, 2021

可以提供更多信息吗, 比如有没有报错, 以及使用的方式(代码片段)

/// 在web内可以正常运行
--------------------------router.js--------------------------

import { createMemoryHistory, createRouter } from "vue-router";
import Layout from "@/page/Layout";
import Details from "@/page/home/details/Details";

const routerHistory = createMemoryHistory();

const router = createRouter({
  history: routerHistory,
  routes: [
    {
      path: "/",
      component: Layout,
    },
    {
      path: "/home",
      component: Layout,
    },
    {
      path: "/details",
      component: Details,
    },
  ]
})

export default router

--------------------------App.vue--------------------------

<template>
  <div id="#app">
    <router-view/>
  </div>
</template>

<script>

export default {
  name: 'App'
}
</script>

--------------------------Layout.vue--------------------------

<template>
  <div>
    <div @click="goto" :style="{fontSize: '40px'}">进入details</div>
  </div>
</template>

<script>

export default {
  name: 'Layout',
  methods: {
    goto() {
      this.$router.push('/details')
    }
  }
}
</script>

--------------------------Detail.vue--------------------------

<template>
  <div :style="{fontSize: '40px'}">
    Details
  </div>
</template>

<script>

export default {
  name: 'Details'
}
</script>

--------------------------cmd打印(白屏)--------------------------

leedeMacBook-Pro:beihai_nl_demo lee$ kraken ./dist/js/app.js
Execute binary: /usr/local/lib/node_modules/@openkraken/cli/build/darwin/debug/app.app/Contents/MacOS/app 

flutter: Observatory listening on http://127.0.0.1:63445/81Ghh7lD9XI=/
flutter: ERROR: unexpected element type "SCRIPT"
flutter: Kraken DevTool listening at ws://10.9.18.95:9222
flutter: Open Chrome/Edge and paste following url to your navigator:
flutter:     devtools://devtools/bundled/inspector.html?ws=10.9.18.95:9222

--------------------------flutter doctor--------------------------

leedeMacBook-Pro:~ lee$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.0, on Mac OS X 10.15.7 19H114, locale
    zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.1)
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.55.2)

@olin2011
Copy link

可以提供更多信息吗, 比如有没有报错, 以及使用的方式(代码片段)

/// 在web内可以正常运行
--------------------------router.js--------------------------

import { createWebHashHistory, createRouter } from "vue-router";
import Layout from "@/page/Layout";
import Details from "@/page/home/details/Details";

const routerHistory = createWebHashHistory();

const router = createRouter({
  history: routerHistory,
  routes: [
    {
      path: "/",
      component: Layout,
    },
    {
      path: "/home",
      component: Layout,
    },
    {
      path: "/details",
      component: Details,
    },
  ]
})

export default router

--------------------------App.vue--------------------------

<template>
  <div id="#app">
    <router-view/>
  </div>
</template>

<script>

export default {
  name: 'App'
}
</script>

--------------------------Layout.vue--------------------------

<template>
  <div>
    <div @click="goto" :style="{fontSize: '40px'}">进入details</div>
  </div>
</template>

<script>

export default {
  name: 'Layout',
  methods: {
    goto() {
      this.$router.push('/details')
    }
  }
}
</script>

--------------------------Detail.vue--------------------------

<template>
  <div :style="{fontSize: '40px'}">
    Details
  </div>
</template>

<script>

export default {
  name: 'Details'
}
</script>

--------------------------cmd打印(白屏)--------------------------

leedeMacBook-Pro:beihai_nl_demo lee$ kraken ./dist/js/app.js
Execute binary: /usr/local/lib/node_modules/@openkraken/cli/build/darwin/debug/app.app/Contents/MacOS/app 

flutter: Observatory listening on http://127.0.0.1:63445/81Ghh7lD9XI=/
flutter: ERROR: unexpected element type "SCRIPT"
flutter: Kraken DevTool listening at ws://10.9.18.95:9222
flutter: Open Chrome/Edge and paste following url to your navigator:
flutter:     devtools://devtools/bundled/inspector.html?ws=10.9.18.95:9222

--------------------------flutter doctor--------------------------

leedeMacBook-Pro:~ lee$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.0, on Mac OS X 10.15.7 19H114, locale
    zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.1)
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.55.2)

同样的问题,flutter已经切换回1.22.0,虚拟机白屏

@zhengzhuang96
Copy link

同vue路由手机端白屏,在flutter上不支持vue的路由吗

@ghost
Copy link

ghost commented May 25, 2021

react-router 也是白屏。
Uncaught (in promise) TypeError: Cannot read property 'length' of undefined
at b._requestNavigationHistory

@answershuto
Copy link
Member

缺少了 querySelector 与 history 能力。
#41
#422

@andycall andycall added this to the 0.9 milestone Jun 22, 2021
@andycall andycall added this to To Do in Front-End developer experience via automation Jun 22, 2021
@andycall andycall added this to To Do in Browser Features Jun 22, 2021
@andycall andycall added the P3 label Jun 23, 2021
Browser Features automation moved this from To Do to Done Oct 11, 2021
Front-End developer experience automation moved this from To Do to Done Oct 11, 2021
@colorfulldays
Copy link

flutter 2.0 现在还不支持

我用 flutter 2.5 kraken 0.8.4 也不行

@answershuto
Copy link
Member

flutter 2.0 现在还不支持

我用 flutter 2.5 kraken 0.8.4 也不行

0.9.0-rc.3

@colorfulldays
Copy link

flutter 2.0 现在还不支持

我用 flutter 2.5 kraken 0.8.4 也不行

0.9.0-rc.3

npm 最新就是 0.8.4了 这个版本怎么装

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P3
Development

Successfully merging a pull request may close this issue.

7 participants