Skip to content

Commit 352b166

Browse files
author
Guillaume Chau
committed
refactor(ui): webpack-dashboard: simplify open-app
1 parent 7d98d69 commit 352b166

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

packages/@vue/cli-service/ui.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
const { openBrowser } = require('@vue/cli-shared-utils')
2-
31
module.exports = api => {
4-
const { setSharedData, getSharedData, removeSharedData, onAction } = api.namespace('webpack-dashboard-')
2+
const { setSharedData, removeSharedData } = api.namespace('webpack-dashboard-')
53

64
function resetSharedData (key) {
75
setSharedData(`${key}-status`, null)
@@ -258,8 +256,4 @@ module.exports = api => {
258256
setSharedData('serve-url', data.vueServe.url)
259257
}
260258
})
261-
onAction('open-app', () => {
262-
const url = getSharedData('serve-url')
263-
url && openBrowser(url.value)
264-
})
265259
}

packages/@vue/cli-ui-addon-webpack/src/components/WebpackDashboard.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
icon-left="open_in_browser"
1212
:label="$t('vue-webpack.dashboard.open-app')"
1313
:disabled="!serveUrl"
14-
@click="$callPluginAction('webpack-dashboard-open-app')"
14+
:href="serveUrl"
15+
target="_blank"
1516
/>
1617
<VueIcon
1718
icon="lens"

0 commit comments

Comments
 (0)