forked from devsam/core
js2ts: currentCity
This commit is contained in:
@@ -31,9 +31,7 @@ $templates = new \League\Plates\Engine('templates');
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('dist_js/vendors.js')?>
|
||||
<?=WebUtil::printJS('dist_js/common.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/select2/select2.full.min.js')?>
|
||||
<?=WebUtil::printJS('js/currentCity.js')?>
|
||||
<?=WebUtil::printJS('dist_js/currentCity.js')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../e_lib/select2/select2.min.css')?>
|
||||
<?=WebUtil::printCSS('../e_lib/select2/select2-bootstrap4.css')?>
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import $ from 'jquery';
|
||||
import { exportWindow } from './util/exportWindow';
|
||||
import Popper from 'popper.js';
|
||||
exportWindow(Popper, 'Popper');
|
||||
import 'bootstrap';
|
||||
import 'select2/dist/js/select2.full.js'
|
||||
|
||||
|
||||
$(function() {
|
||||
$('#citySelector').select2({
|
||||
theme: 'bootstrap4',
|
||||
placeholder: "도시를 선택해 주세요.",
|
||||
allowClear: false,
|
||||
language: "ko",
|
||||
containerCss: {
|
||||
display: "inline-block !important",
|
||||
color: 'white !important'
|
||||
},
|
||||
containerCssClass: 'simple-select2-align-center bg-secondary text-secondary',
|
||||
dropdownCssClass: 'simple-select2-align-center bg-secondary text-secondary',
|
||||
});
|
||||
$('#citySelector').on('select2:select', function(e){
|
||||
const data = e.params.data;
|
||||
if(!data.selected || data.disabled){
|
||||
return;
|
||||
}
|
||||
const $obj = $('#citySelector').parents('form');
|
||||
$obj.trigger('submit');
|
||||
console.log($obj);
|
||||
});
|
||||
});
|
||||
@@ -36,6 +36,7 @@ module.exports = (env, argv) => {
|
||||
main: '@/main.ts',
|
||||
dipcenter: '@/dipcenter.ts',
|
||||
diplomacy: '@/diplomacy.ts',
|
||||
currentCity: '@/currentCity.ts',
|
||||
|
||||
|
||||
//FORM 입력용, frontend 변경후 제거
|
||||
|
||||
Reference in New Issue
Block a user