All Projects → saintplay → vue-flexible-link

saintplay / vue-flexible-link

Licence: MIT license
Tiny Vue component for Electron to open links in a browser. Ideal for cross environment apps (Web & Native)

Programming Languages

javascript
184084 projects - #8 most used programming language
Vue
7211 projects

Projects that are alternatives of or similar to vue-flexible-link

gophersnake
Stand-alone Gopher client for modern desktops
Stars: ✭ 14 (-36.36%)
Mutual labels:  desktop-app
squoosh-desktop-app
Squoosh Desktop App is a multiplatform desktop app to compress, resize, and crop your images.
Stars: ✭ 141 (+540.91%)
Mutual labels:  desktop-app
violin
🎵 Minimalistic music player for desktop devices.
Stars: ✭ 40 (+81.82%)
Mutual labels:  desktop-app
elephicon
A GUI wrapper for png2icons.
Stars: ✭ 90 (+309.09%)
Mutual labels:  desktop-app
12306-electron
🚄 electron-vue构建12306跨平台(Mac、Windows、Linux)客户端
Stars: ✭ 125 (+468.18%)
Mutual labels:  electron-vue
network-smoothie
Dead simple internet bonding. Take advantege of multiple network adapters.
Stars: ✭ 14 (-36.36%)
Mutual labels:  desktop-app
jdeploy
Developer friendly desktop deployment tool
Stars: ✭ 282 (+1181.82%)
Mutual labels:  desktop-app
smartsilo
Hardware-integrated system composed by a desktop app and a Node.js server able to control an Arduino and manipulate the temperature of grains within storage silos
Stars: ✭ 33 (+50%)
Mutual labels:  desktop-app
docker lnmp
一键部署基于docker的LAMP环境,并利用electron + vue 提供gui管理。+++ 可配置的多进程php扩展安装
Stars: ✭ 37 (+68.18%)
Mutual labels:  electron-vue
Pixeval
Wow. Yet another Pixiv client!
Stars: ✭ 1,639 (+7350%)
Mutual labels:  desktop-app
JetTunes-Desktop-Music-Player
Material design music player made with javafx
Stars: ✭ 36 (+63.64%)
Mutual labels:  desktop-app
jspaint.exe
🌂JS Paint ~~ as a cross-platform native desktop app. In other words, the "🎨 Classic MS Paint, REVIVED + ✨Extras".exe hehe
Stars: ✭ 117 (+431.82%)
Mutual labels:  desktop-app
InvMan
Open source JavaFX inventory management application
Stars: ✭ 40 (+81.82%)
Mutual labels:  desktop-app
electron-admin-element-vue
Electron Vue3.x Element-UI Admin
Stars: ✭ 37 (+68.18%)
Mutual labels:  electron-vue
NotifyTools
三国志英杰传游戏复刻 3guoheros;AI-FACES:人脸检测 lfw;C10K:netty/nodejs websocket/socketio长连接;SeetaFaceEngine:源码集成编译;android:联系人备份、天气、进程清理、万年历、行政区划、录音截屏;KOTLIN:BING壁纸;C++C#:COM组件事件回调;JAVA:sqlite数据库转greendao bean;china-pome:唐宋诗词;1bpp-monochrome-bitmap:android bitmap转存单色位图; face-detection:opencv人脸检测;iptools:nodejs/typescript扫描IP;
Stars: ✭ 34 (+54.55%)
Mutual labels:  electron-vue
MagicBox
Organize your workspace, keep files optimized, prepare images for publishing
Stars: ✭ 65 (+195.45%)
Mutual labels:  desktop-app
InventoryDesktopFlutterApp
Implementation of Flutter Desktop Application
Stars: ✭ 36 (+63.64%)
Mutual labels:  desktop-app
unicodemoticon
Trayicon with Unicode Emoticons using Python3 Qt5
Stars: ✭ 21 (-4.55%)
Mutual labels:  desktop-app
geeks-life
(WIP) Log daily life
Stars: ✭ 14 (-36.36%)
Mutual labels:  desktop-app
flutter desktop markdown reader
Experimental MacOS Markdown reader made with Flutter
Stars: ✭ 55 (+150%)
Mutual labels:  desktop-app

Vue Flexible Link

vue2

Tiny Vue Component to open links in a browser, ideal for cross environment apps(Web and Native Desktop with Electron)

  • If you are in a electron app opens the link in a new browser tab with the shell.openExternal API.
  • If you are in a web, the component will be a regular web link

This component was tested with webpack only

Installation

npm install --save vue-flexible-link

or

yarn add vue-flexible-link

Usage

<flexible-link :native="isElectronBuild" href="https://github.com/upclab/finance-wheel">
  <span class="icon" style="color: #333;">
    <icon name="github" scale="3"></icon>
  </span>
</flexible-link>
<script>
import FlexibleLink from 'vue-flexible-link/src/FlexibleLink.vue';

export default {
  data() {
    return {
      /*
        In this example ELECTRON_BUILD is a global variable
        defined at build time
      */
      isElectronBuild: !!ELECTRON_BUILD,
    };
  },
  components: {
    FlexibleLink,
  },
};
</script>
  // In the webpack config "DefinePlugin" is our friend
  plugins: [
    new webpack.DefinePlugin({
      ELECTRON_BUILD: true,
    }),
  ],

Props

Prop Type Description Default Value
native Boolean Wheter the build for native(electron) environment true
custom-class String Use your custom class on the component -
href String Attach your href on the component '/'
target String Attach the target like 'blank' '_self'

Possible Scenarios

1. Cross Environment(Web and Electron)

Make sure your build targets are configured to electron-renderer and electron-main

You need the import the non-compiled component

import FlexibleLink from 'vue-flexible-link/src/FlexibleLink'

And you need the add the node's fs mock to your webpack configuration to get this working:

entry: {
// ...
},
output: {
// ...
},
module: {
// ...
},
node: {
  fs: 'empty', // fs works only with the 'empty' value 
},

2. For Electron Environment Only

Make sure your build targets are configured to electron-renderer and electron-main

You can import the component like this

import FlexibleLink from 'vue-flexible-link'

And you should be fine

3. For Web Environment Only

Yeah, this component doesn't make sense if you are building a web app only. Don't use it for this case.

Note

If you are having trouble configuring the builds you may want to check out the config of my cross env project finance-wheel based on official webpack template

Roadmap

  • Add functionality to check the environment automatically
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].