
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
gos-viewer
Advanced tools
一个支持多文件格式的web文件查看器
npm install gos-viewer -S
或者
yarn add gos-viewer
在 main.js 引入
import GosViewer from 'gos-viewer'
Vue.use(GosViewer)
在页面中使用
<template>
<div>
<input
ref="file"
class="file-select"
type="file"
@change="handleChange"
/>
</div>
</template>
<script>
export default {
name: 'DemoPage',
data () {
return {
file: null
}
},
created () {
// 初始化文件查看器
this.$gosViewer.init()
// 监听关闭事件
this.$gosViewer.onWindowClose(() => {
// 重置文件表单
this.$refs.file.value = ''
})
},
methods: {
handleChange (e) {
// 获取选择的文件
const [file] = e.target.files
// 打开文件
this.$gosViewer.open({
data: file
})
}
}
}
</script>
<script>
export default {
name: "TestEmbedMode",
data() {
return {
file: {
file: new File(["666"], "index.txt", {
type: "text/plain",
}), // 文件
type: "text", // 打开类型
},
};
},
};
</script>
<template>
<div>
<gos-viewer
ref="gosViewer"
width="1200px"
height="800px"
v-model="file"
style="border: 1px solid #ddd"
></gos-viewer>
</div>
</template>
FAQs
A file viewer that supports multiple file formats.
We found that gos-viewer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.