ステッパーコンポーネント(GcStepper)では、各ステップのアイコンを設定できます。
アイコン
stepsプロパティの各ステップオブジェクトでiconプロパティを指定することで、ステップごとに任意のアイコンを表示できます。
設定例は以下の通りです。
<template>
<div class="container">
<GcStepperComponent @oninitialized="gcStepperRef = $event">
<GcStepperStepComponent :label="'お名前'" :icon="userIcon">
<div id="form1">
<GcTextBoxComponent :watermarkDisplayNullText="'名前'" :width="300" :height="35" />
<button class="nextBtn" @click="gcStepperRef.next()">次へ</button>
</div>
</GcStepperStepComponent>
<GcStepperStepComponent :label="'メールアドレス'" :icon="emailIcon">
<div id="form2">
<GcTextBoxComponent :watermarkDisplayNullText="'メールアドレス'" :width="300" :height="35" />
<div class="button-group">
<button class="prevBtn" @click="gcStepperRef.previous()">戻る</button>
<button class="nextBtn" @click="gcStepperRef.next()">次へ</button>
</div>
</div>
</GcStepperStepComponent>
<GcStepperStepComponent :label="'送信完了'" :icon="doneIcon">
<div style="text-align: center; padding: 5px">
<h3>正常に会員登録が完了いたしました。</h3>
<p>ご登録いただいたメールアドレスに認証メールをお送りいたしました。</p>
</div>
</GcStepperStepComponent>
</GcStepperComponent>
</div>
</template>
<script setup>
import '@mescius/inputman/CSS/gc.inputman-js.css';
import { ref } from 'vue';
import '@mescius/inputman.vue';
import { GcStepperComponent, GcStepperStepComponent, GcTextBoxComponent } from '@mescius/inputman.vue';
import { InputMan } from "@mescius/inputman";
import "./styles.css";
import "./modern-styles.css";
InputMan.appearanceStyle = InputMan.AppearanceStyle.Modern;
const gcStepperRef = ref(null);
const userIcon = `<img src="$IMDEMOROOT$/ja/samples/stepper/icon/img/user.svg" alt="お名前" style="width:1em;height:1em;">`;
const emailIcon = `<img src="$IMDEMOROOT$/ja/samples/stepper/icon/img/email.svg" alt="メールアドレス" style="width:1em;height:1em;">`;
const doneIcon = `<img src="$IMDEMOROOT$/ja/samples/stepper/icon/img/done.svg" alt="送信完了" style="width:1em;height:1em;">`;
</script>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ステッパーコンポーネント - 概要</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="systemjs.config.js"></script>
<script src="compiler.js" type="module"></script>
<script>
window.onload = function() {
var System = SystemJS;
System.import("./src/app.js");
}
</script>
</head>
<body>
<div id="app"></div>
</body>
</html>
button {
min-width: 60px;
padding: 5px 7px;
border: none;
border-radius: 6px;
background: #0056d6;
color: #fff;
font-size: 0.8em;
font-weight: 300;
cursor: pointer;
margin-left: 10px;
margin-top: 10px;
box-shadow: 0 1px 3px #0056d61a;
}
.container {
border: 1px solid #ccc;
margin: 10px auto;
background: #fff;
border-radius: 12px;
box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
padding: 32px 36px 28px 36px;
}
.prevBtn,
.panel button {
background: #f3f4f6;
color: #2d3a4b;
border: 1px solid #e0e0e0;
}
.step {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
#form1,
#form2 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
}
#form2 input {
margin-bottom: 10px;
}
#form2 .button-group {
display: flex;
gap: 10px;
}
.gcim_watermark_null {
color: lightgrey;
}
button {
min-width: 60px;
padding: 5px 7px;
border: none;
border-radius: 6px;
background: #0056d6;
color: #fff;
font-size: 0.8em;
font-weight: 300;
cursor: pointer;
margin-left: 10px;
margin-top: 10px;
box-shadow: 0 1px 3px #0056d61a;
}
.prevBtn,
.panel button {
background: #f3f4f6;
color: #2d3a4b;
border: 1px solid #e0e0e0;
}
.step {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
#form1,
#form2 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
}
#form2 input {
margin-bottom: 10px;
}
#form2 .button-group {
display: flex;
gap: 10px;
}
[gcim-control-appearance="modern"] .gcim_watermark_null {
color: lightgrey;
}
(function (global) {
SystemJS.config({
transpiler: 'plugin-babel',
babelOptions: {
es2015: true
},
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
packageConfigPaths: [
'./node_modules/*/package.json',
"./node_modules/@mescius/*/package.json",
"./node_modules/@babel/*/package.json",
"./node_modules/@vue/*/package.json"
],
map: {
'vue': "npm:vue/dist/vue.esm-browser.js",
'plugin-babel': 'npm:systemjs-plugin-babel/plugin-babel.js',
"systemjs-babel-build": "npm:systemjs-plugin-babel/systemjs-babel-browser.js",
"@mescius/inputman": 'npm:@mescius/inputman/index.js',
"@mescius/inputman.vue": 'npm:@mescius/inputman.vue/lib/gc.inputman.plugin.vue.js',
"@mescius/inputman/CSS": "npm:@mescius/inputman/CSS",
"@mescius/inputman.richtexteditor": "npm:@mescius/inputman.richtexteditor/index.js",
"@mescius/inputman.richtexteditor.vue": "npm:/@mescius/inputman.richtexteditor.vue/lib/gc.inputman.richtexteditor.plugin.vue.js",
"@mescius/inputman.richtexteditor/CSS": "npm:@mescius/inputman.richtexteditor/CSS",
'@mescius/inputman.richtexteditor/JS/plugins/advlist': 'npm:@mescius/inputman.richtexteditor/JS/plugins/advlist/plugin.js',
'@mescius/inputman.richtexteditor/JS/plugins/all': 'npm:@mescius/inputman.richtexteditor/JS/plugins/all/plugin.js',
'@mescius/inputman.richtexteditor/JS/plugins/autosave': 'npm:@mescius/inputman.richtexteditor/JS/plugins/autosave/plugin.js',
'@mescius/inputman.richtexteditor/JS/plugins/charmap': 'npm:@mescius/inputman.richtexteditor/JS/plugins/charmap/plugin.js',
'@mescius/inputman.richtexteditor/JS/plugins/directionality': 'npm:@mescius/inputman.richtexteditor/JS/plugins/directionality/plugin.js',
'@mescius/inputman.richtexteditor/JS/plugins/emoticons': 'npm:@mescius/inputman.richtexteditor/JS/plugins/emoticons/plugin.js',
'@mescius/inputman.richtexteditor/JS/plugins/fullscreen': 'npm:@mescius/inputman.richtexteditor/JS/plugins/fullscreen/plugin.js',
'@mescius/inputman.richtexteditor/JS/plugins/htmlcode': 'npm:@mescius/inputman.richtexteditor/JS/plugins/htmlcode/plugin.js',
'@mescius/inputman.richtexteditor/JS/plugins/image': 'npm:@mescius/inputman.richtexteditor/JS/plugins/image/plugin.js',
'@mescius/inputman.richtexteditor/JS/plugins/link': 'npm:@mescius/inputman.richtexteditor/JS/plugins/link/plugin.js',
'@mescius/inputman.richtexteditor/JS/plugins/lists': 'npm:@mescius/inputman.richtexteditor/JS/plugins/lists/plugin.js',
'@mescius/inputman.richtexteditor/JS/plugins/media': 'npm:@mescius/inputman.richtexteditor/JS/plugins/media/plugin.js',
'@mescius/inputman.richtexteditor/JS/plugins/pagebreak': 'npm:@mescius/inputman.richtexteditor/JS/plugins/pagebreak/plugin.js',
'@mescius/inputman.richtexteditor/JS/plugins/preview': 'npm:@mescius/inputman.richtexteditor/JS/plugins/preview/plugin.js',
'@mescius/inputman.richtexteditor/JS/plugins/save': 'npm:@mescius/inputman.richtexteditor/JS/plugins/save/plugin.js',
'@mescius/inputman.richtexteditor/JS/plugins/searchreplace': 'npm:@mescius/inputman.richtexteditor/JS/plugins/searchreplace/plugin.js',
'@mescius/inputman.richtexteditor/JS/plugins/table': 'npm:@mescius/inputman.richtexteditor/JS/plugins/table/plugin.js',
'@mescius/inputman.richtexteditor/JS/plugins/template': 'npm:@mescius/inputman.richtexteditor/JS/plugins/template/plugin.js',
'@mescius/inputman.richtexteditor/JS/plugins/wordcount': 'npm:@mescius/inputman.richtexteditor/JS/plugins/wordcount/plugin.js',
"@mescius/inputman.comment": 'npm:@mescius/inputman.comment/index.js',
"@mescius/inputman.comment.vue": 'npm:@mescius/inputman.comment.vue/lib/gc.inputman.comment.plugin.vue.js',
"@mescius/inputman.comment/CSS": "npm:@mescius/inputman.comment/CSS",
'@mescius/wijmo': 'npm:@mescius/wijmo/index.js',
'@mescius/wijmo.styles': 'npm:@mescius/wijmo.styles',
'@mescius/wijmo.cultures': 'npm:@mescius/wijmo.cultures/wijmo.culture.ja.js',
'@mescius/wijmo.nav': 'npm:@mescius/wijmo.nav/index.js',
'@mescius/wijmo.input': 'npm:@mescius/wijmo.input/index.js',
'@mescius/wijmo.grid': 'npm:@mescius/wijmo.grid/index.js',
'@mescius/spread-sheets': 'npm:@mescius/spread-sheets/index.js',
'@mescius/spread-sheets-resources-ja': 'npm:@mescius/spread-sheets-resources-ja/index.js',
'@mescius/spread-sheets/styles': 'npm:@mescius/spread-sheets/styles',
'css': 'npm:systemjs-plugin-css/css.js',
},
meta: {
'*.css': { loader: 'css' },
'*.vue': { loader: "../plugin-vue/index.js" }
}
});
})(this);