英文:
hierarchical-checkboxes: not showing correctly
问题
我正在使用以下链接创建一个分层树状视图。
https://www.htmlelements.com/demos/tree/hierarchical-checkboxes/
但是,当我使用它时,它显示如下(缺少复选标记、箭头等):
我的代码如下(ui.html):
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="static/smart.default.css" type="text/css" />
<script type="text/javascript" src="static/smart.tree.js"></script>
</head>
<body class="viewport">
<smart-tree id="tree" has-three-states selection-mode="checkBox">
<smart-tree-item>IPV4</smart-tree-item>
<smart-tree-items-group>
IPSEC
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<!-- 其他代码省略 -->
</smart-tree>
</body>
</html>
我的代码结构如下:
我已经将两个文件复制到static目录下:
- smart.default.css
- smart.tree.js
我是新手,任何帮助以获得相同的UI都将受到鼓励。
英文:
I am using the below link to create a hierarchical treeview.
https://www.htmlelements.com/demos/tree/hierarchical-checkboxes/
It should be displayed like the below:
However, when I am using it, it displays like this (checkmarks, arrow etc missing):
My code is below(ui.html):
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="static/smart.default.css" type="text/css" />
<script type="text/javascript" src="static/smart.tree.js"></script>
</head>
<body class="viewport">
<smart-tree id="tree" has-three-states selection-mode="checkBox">
<smart-tree-item>IPV4</smart-tree-item>
<smart-tree-items-group>
IPSEC
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-items-group>
IPSEC_QOS
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-items-group>
IPSEC_QOS_DPI_FNF
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-items-group>
IPSEC_QOS_DPI_FNF_TNAT
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-items-group>
IPSEC_QOS_DPI_FNF_SNAT_ZBFW
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-item>MCAST</smart-tree-item>
<smart-tree-items-group>
IPSEC_MCAST
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-items-group>
IPSEC_QOS_DPI_FNF_MCAST
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-item>IPV6</smart-tree-item>
<smart-tree-items-group>
IPSECV6
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-items-group>
IPSECV6_QOSV6_DPI_FNF
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
</smart-tree>
</body>
</html>
My code structure is:
I have copied the 2 files under static:
- smart.default.css
- smart.tree.js
I am new to this and any help to get the same UI would be encouraging.
答案1
得分: 0
你可能忘记添加所需的样式。以下是已翻译的部分:
<link href="https://www.htmlelements.com/demos/styles/demos.css" rel="stylesheet"/>
<link href="https://www.htmlelements.com/demos/styles/codepen.css" rel="stylesheet"/>
<link href="https://www.htmlelements.com/demos/source/styles/smart.default.css" rel="stylesheet"/>
<script src="https://www.htmlelements.com/demos/source/smart.elements.js"></script>
<script src="https://www.htmlelements.com/demos/scripts/data.js"></script>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="static/smart.default.css" type="text/css" />
<script type="text/javascript" src="static/smart.tree.js"></script>
</head>
<body class="viewport">
<smart-tree id="tree" has-three-states selection-mode="checkBox">
<smart-tree-item>IPV4</smart-tree-item>
<smart-tree-items-group>
IPSEC
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-items-group>
IPSEC_QOS
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-items-group>
IPSEC_QOS_DPI_FNF
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-items-group>
IPSEC_QOS_DPI_FNF_TNAT
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-items-group>
IPSEC_QOS_DPI_FNF_SNAT_ZBFW
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-item>MCAST</smart-tree-item>
<smart-tree-items-group>
IPSEC_MCAST
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-items-group>
IPSEC_QOS_DPI_FNF_MCAST
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-item>IPV6</smart-tree-item>
<smart-tree-items-group>
IPSECV6
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-items-group>
IPSECV6_QOSV6_DPI_FNF
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
</smart-tree>
</body>
</html>
如果还需要其他翻译,请提供具体内容。
英文:
You might have missed adding the required styles.
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
<link href="https://www.htmlelements.com/demos/styles/demos.css" rel="stylesheet"/>
<link href="https://www.htmlelements.com/demos/styles/codepen.css" rel="stylesheet"/>
<link href="https://www.htmlelements.com/demos/source/styles/smart.default.css" rel="stylesheet"/>
<script src="https://www.htmlelements.com/demos/source/smart.elements.js"></script>
<script src="https://www.htmlelements.com/demos/scripts/data.js"></script>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="static/smart.default.css" type="text/css" />
<script type="text/javascript" src="static/smart.tree.js"></script>
</head>
<body class="viewport">
<smart-tree id="tree" has-three-states selection-mode="checkBox">
<smart-tree-item>IPV4</smart-tree-item>
<smart-tree-items-group>
IPSEC
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-items-group>
IPSEC_QOS
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-items-group>
IPSEC_QOS_DPI_FNF
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-items-group>
IPSEC_QOS_DPI_FNF_TNAT
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-items-group>
IPSEC_QOS_DPI_FNF_SNAT_ZBFW
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-item>MCAST</smart-tree-item>
<smart-tree-items-group>
IPSEC_MCAST
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-items-group>
IPSEC_QOS_DPI_FNF_MCAST
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-item>IPV6</smart-tree-item>
<smart-tree-items-group>
IPSECV6
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
<smart-tree-items-group>
IPSECV6_QOSV6_DPI_FNF
<smart-tree-item>IMIX</smart-tree-item>
<smart-tree-item>1400</smart-tree-item>
</smart-tree-items-group>
</smart-tree>
</body>
</html>
<!-- end snippet -->
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论