怎么查看iocn图标有哪些
时间: 2023-09-22 16:15:25 浏览: 46
有很多网站可以查看和下载icon图标,以下是一些常用的网站:
1. Font Awesome(https://fontawesome.com/):提供了超过1500个免费的图标和图标集,可以通过CSS或SVG使用。
2. Iconfont(https://www.iconfont.cn/):阿里巴巴矢量图标库,提供了大量的免费图标和图标集,可以通过CSS或SVG使用。
3. Material Design Icons(https://material.io/resources/icons/):谷歌提供的Material Design风格图标库,提供了超过4000个免费的图标和图标集,可以通过CSS或SVG使用。
4. Flaticon(https://www.flaticon.com/):提供了超过300万个免费图标和图标集,可以通过PNG、SVG、EPS、PSD和Base 64格式使用。
5. Iconfinder(https://www.iconfinder.com/):提供了超过400万个免费和付费图标和图标集,可以通过PNG、SVG、EPS、AI和Base 64格式使用。
在这些网站上,可以通过搜索、分类或标签等方式查找所需的图标。同时,这些网站也提供了一些工具和资源,例如图标编辑器、插件和教程,有助于更好地使用和应用图标。
相关问题
el-iocn 使用自定义svg
在使用 Element Plus 的 el-icon 组件时,可以使用自定义的 SVG 图标。具体步骤如下:
1. 安装 `@iconify/iconify` 和 `@iconify/vue` 两个库。
```bash
npm install @iconify/iconify @iconify/vue
```
2. 在项目中注册自定义的 SVG 图标。可以在 `main.js` 中进行全局注册,也可以在组件中局部注册。
```javascript
// main.js
import { Icon } from '@iconify/vue';
import locationIcon from '@iconify-icons/mdi/map-marker';
app.component('icon', Icon);
Iconify.addIcon('location', locationIcon);
```
这里我们注册了一个名为 `location` 的 SVG 图标。
3. 在 el-icon 组件中使用自定义的 SVG 图标。可以通过设置 `icon` 属性来指定图标名称,或者直接将 SVG 图标作为子组件的内容。
```vue
<template>
<div>
<el-icon icon="location"></el-icon>
<el-icon>
<svg-icon :icon="locationIcon" />
</el-icon>
</div>
</template>
<script>
import { Icon } from '@iconify/vue';
import locationIcon from '@iconify-icons/mdi/map-marker';
export default {
components: {
Icon,
},
data() {
return {
locationIcon,
};
},
};
</script>
```
这里我们使用了两种方式来显示自定义的 SVG 图标:一种是通过 `icon` 属性来指定图标名称,另一种是将 SVG 图标作为子组件的内容。需要注意的是,在第二种方式中,我们需要将 SVG 图标的名称作为属性传递给子组件。
import javafx.application.Application; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.scene.*; import javafx.scene.layout.AnchorPane; import javafx.scene.text.Font; import javafx.stage.*; import javafx.scene.control.*; public class Main extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) throws Exception { Button b1=new Button("账号登录"); b1.setPrefWidth(100); b1.setPrefHeight(20); b1.setStyle( "-fx-background-color: #B22222;"+ "-fx-text-fill: #FFFAFA;" ); Label label=new Label("账号 :"); Label label2=new Label("密码 :"); label.setFont(Font.font(13)); label2.setFont(Font.font(13)); TextField textField1=new TextField(); textField1.setPrefHeight(25); textField1.setPrefWidth(200); textField1.setFont(Font.font(12)); Tooltip tip=new Tooltip("请输入12位学号"); textField1.setPromptText("请输入12位学号"); tip.setFont(Font.font(10)); textField1.setTooltip(tip); PasswordField passwordField=new PasswordField(); passwordField.setPrefHeight(25); passwordField.setPrefWidth(200); Tooltip tooltip2=new Tooltip("请输入八位密码"); passwordField.setPromptText("请输入八位密码"); textField1.textProperty().addListener((new ChangeListener<String>() { @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) { if (newValue.length()>12){ textField1.setText(oldValue); } } })); passwordField.textProperty().addListener((new ChangeListener<String>() { @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) { if (newValue.length()>8){ passwordField.setText(oldValue); } } })); /*ImageView img = new ImageView(); Image image=new Image(getClass().getResourceAsStream("/image/iocn.jpg")); img.setImage(image);*/ passwordField.setTooltip(tooltip2); AnchorPane anchorPane=new AnchorPane(textField1); anchorPane.getChildren().add(passwordField); anchorPane.getChildren().add(b1); anchorPane.getChildren().addAll(label2,label); anchorPane.setTopAnchor(label,150.0); anchorPane.setLeftAnchor(label,140.0); anchorPane.setTopAnchor(label2,180.0); anchorPane.setLeftAnchor(label2,140.0); anchorPane.setTopAnchor(textField1,150.0); anchorPane.setLeftAnchor(textField1,180.0); anchorPane.setTopAnchor(passwordField,180.0); anchorPane.setLeftAnchor(passwordField,180.0); anchorPane.setTopAnchor(b1,220.0); anchorPane.setLeftAnchor(b1,220.0); Scene scene=new Scene(anchorPane); primaryStage.setHeight(500); primaryStage.setWidth(550); primaryStage.setScene(scene); primaryStage.show(); } }
这段代码是一个JavaFX的应用程序,用于创建一个窗口和一个按钮。其中,import语句用于导入JavaFX的相关类库,Application是JavaFX应用程序的基类,main方法是程序的入口,start方法是JavaFX应用程序的主要方法,用于创建和显示GUI界面。在start方法中,创建了一个Button对象,并设置了它的文本、宽度、高度和样式。其中,样式使用了CSS语法,用于设置按钮的背景颜色。整个程序的作用是创建一个简单的GUI界面,用于账号登录。