vue和element-ui初步使用

是一套用于构建用户界面的渐进式框架。与其它大型框架不同的是,Vue 被设计为可以自底向上逐层应用。Vue 的核心库只关注视图层,不仅易于上手,还便于与第三方库或既有项目整合。另一方面,当与现代化的工具链以及各种支持类库结合使用时,Vue 也完全能够为复杂的单页应用提供驱动。是一种 MVVM (Model-View-ViewModel)

  1. 使用vue首先是需要导入vue.js,下面就是简单的vue对象

Linux下搭建vue环境以及出现No command 'vue'found

搭建nodejs环境

1
2
3
4
5
6
1. 下载node的Linux版2. 解压后放在/user/local/ 下或者其他位置3. 设置国内的淘宝源  
npm config set registry=https://registry.npm.taobao.org
或者使用
npm install -g cnpm --registry=https://registry.npm.taobao.org
安装完成后同样要建软链接,否则在使用
cnpm时会报No command 'cnpm' found的错误。sudo ln -s /home/formularoom/env/node-v8.1.2-linux-x64/bin/cnpm /usr/local/bin/cnpm

常见npm设置命令 npm config get/set xxxx ,其中xxx代指prefix ,registry等,其对于的配置文件地址 ~/.npmrc

提交文件MultipartFile后ZipEntry.size一直为-1

先看一下代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
public static void importModels (MultipartFile file) throws IOException, InvalidFormatException {
ZipInputStream zipInputStream = new ZipInputStream(file.getInputStream(), Charset.defaultCharset());
BufferedInputStream bs = new BufferedInputStream(zipInputStream);
Map<String, Map> stringMapMap;
Map<String, String> modelJsons = new HashMap<>();
ZipEntry zipEntry;
String zipFileName;
while ((zipEntry = zipInputStream.getNextEntry()) != null) {
if (zipEntry.isDirectory()) { // do nothing

} else if (zipEntry.getName().endsWith("json")) {
String name = zipEntry.getName();

long size = zipEntry.getSize();
if (size == -1) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
while (true) {
int bytes = zipInputStream.read();
if (bytes == -1) {
break;
}
baos.write(bytes);
}
baos.close();
System.out.println(String.format("Name:%s,Content:%s", name, new String(baos.toByteArray())));
} else { // ZipEntry的size正常
byte[] bytes = new byte[(int) zipEntry.getSize()];
zipInputStream.read(bytes, 0, (int) zipEntry.getSize());
System.out.println(String.format("Name:%s,Content:%s", name, new String(bytes)));
}
} else if (zipEntry.getName().endsWith("xlxs")) { //do other things
} else {
return;
}
}
return;
}

ubuntu导致不能复制剪切板

剪切板不能共享

以Ubuntu为主机(host)的系统,在vmware的虚拟机(guest)一直无法复制剪切板上的文字,网上看到的都是给Linux的虚拟机安装 vmware tools 的过程,刚开始以为是Linux主机导致 vmware workspace无法安装

因为我看到所有Windows安装VMware Workstation的软件在有vmware tools后都有重新安装 tools的img

所以后面我都以为是系统缘故导致的